refactor(chalice): product analytics log refactoring (#3043)
This commit is contained in:
parent
e046bcbe0a
commit
f752876675
1 changed files with 6 additions and 5 deletions
|
|
@ -488,11 +488,11 @@ SELECT *
|
|||
FROM pre_ranked_events;"""
|
||||
logger.debug("---------Q1-----------")
|
||||
ch_query1 = ch.format(query=ch_query1, parameters=params)
|
||||
logger.debug(ch_query1)
|
||||
logger.debug(ch_query1.encode('utf-8'))
|
||||
ch.execute(query=ch_query1)
|
||||
if time() - _now > 2:
|
||||
logger.warning(f">>>>>>>>>PathAnalysis long query EE ({int(time() - _now)}s)<<<<<<<<<")
|
||||
logger.warning(ch_query1)
|
||||
logger.warning(ch_query1.encode('utf-8'))
|
||||
logger.warning("----------------------")
|
||||
_now = time()
|
||||
|
||||
|
|
@ -515,10 +515,11 @@ FROM ranked_events
|
|||
{q2_extra_condition if q2_extra_condition else ""};"""
|
||||
logger.debug("---------Q2-----------")
|
||||
ch_query2 = ch.format(query=ch_query2, parameters=params)
|
||||
logger.debug(ch_query2.encode('utf-8'))
|
||||
ch.execute(query=ch_query2)
|
||||
if time() - _now > 2:
|
||||
logger.warning(f">>>>>>>>>PathAnalysis long query EE ({int(time() - _now)}s)<<<<<<<<<")
|
||||
logger.warning(ch_query2)
|
||||
logger.warning(ch_query2.encode('utf-8'))
|
||||
logger.warning("----------------------")
|
||||
_now = time()
|
||||
|
||||
|
|
@ -629,11 +630,11 @@ FROM ranked_events
|
|||
ORDER BY event_number_in_session, sessions_count DESC;"""
|
||||
logger.debug("---------Q3-----------")
|
||||
ch_query3 = ch.format(query=ch_query3, parameters=params)
|
||||
logger.debug(ch_query3)
|
||||
logger.debug(ch_query3.encode('utf-8'))
|
||||
rows = ch.execute(query=ch_query3)
|
||||
if time() - _now > 2:
|
||||
logger.warning(f">>>>>>>>>PathAnalysis long query EE ({int(time() - _now)}s)<<<<<<<<<")
|
||||
logger.warning(ch_query3)
|
||||
logger.warning(ch_query3.encode('utf-8'))
|
||||
logger.warning("----------------------")
|
||||
|
||||
return __transform_journey(rows=rows, reverse_path=reverse)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue