MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _emit_running_query

Function _emit_running_query

src/commands/cmd_info.c:93–123  ·  view source on GitHub ↗

replies with query information

Source from the content-addressed store, hash-verified

91
92// replies with query information
93static void _emit_running_query
94(
95 RedisModuleCtx *ctx, // redis module context
96 const CommandCtx *cmd // command context
97) {
98 ASSERT(ctx != NULL);
99 ASSERT(cmd != NULL);
100
101 // compute query execution time
102 const double total_time = TIMER_GET_ELAPSED_MILLISECONDS(cmd->timer);
103
104 RedisModule_ReplyWithArray(ctx, 5 * 2);
105
106 // emit query received timestamp
107 Info_SectionAddEntryLongLong(ctx, RECEIVED_TIMESTAMP_KEY_NAME,
108 cmd->received_ts);
109
110 // emit graph name
111 Info_SectionAddEntryString(ctx, GRAPH_NAME_KEY_NAME,
112 GraphContext_GetName(cmd->graph_ctx));
113
114 // emit query
115 Info_SectionAddEntryString(ctx, QUERY_KEY_NAME, cmd->query);
116
117 // emit query wait duration
118 Info_SectionAddEntryDouble(ctx, EXECUTION_DURATION_KEY_NAME, total_time);
119
120 // emit rather or not query was replicated
121 Info_SectionAddEntryLongLong(ctx, REPLICATION_KEY_NAME,
122 cmd->replicated_command);
123}
124
125// replies with query information
126static void _emit_waiting_query

Callers 1

_info_running_queriesFunction · 0.85

Calls 4

GraphContext_GetNameFunction · 0.85

Tested by

no test coverage detected