def build_query_monitor(subject: ConsoleSpaceSubject, query_type: str): query_monitor = QueryMonitor() query_monitor.queryUid = get_surrogate_key() query_source = QuerySource() query_source.name = subject.name query_source.queryType = query_type query_monitor.querySource = query_source return query_monitor
def build_query_monitor_report(report: Report, query_type: str): query_monitor = QueryMonitor() query_monitor.queryUid = get_surrogate_key() query_source = QuerySource() query_source.name = report.name query_source.queryType = query_type query_monitor.querySource = query_source return query_monitor
async def sync_query_monitor_data(query_monitor: QueryMonitor): # print(query_monitor) topic_event = TopicEvent(code="raw_query_monitor", data=query_monitor.dict()) # payload = {'code': "raw_query_monitor", "data": query_monitor.json()} # print(settings.HOST_URL+"/topic/data") # print(topic_event.json()) asyncio.ensure_future(import_raw_topic_data(topic_event))
async def sync_query_monitor_data(query_monitor: QueryMonitor): topic_event = TopicEvent(code="raw_query_monitor", data=query_monitor.dict()) asyncio.ensure_future(import_raw_topic_data(topic_event))