Skip to content

Commit eb14f42

Browse files
committed
have emit system free memory within metrics_time_taken_us and also add metric time taken for it
1 parent 6fa696b commit eb14f42

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/modules/keydb_modstatsd/modmain.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,15 +614,17 @@ void event_cron_handler(struct RedisModuleCtx *ctx, RedisModuleEvent eid, uint64
614614
// g_stats->timing("handle_client_info_time_taken_us", ustime() - commandStartTime);
615615
// RedisModule_FreeCallReply(reply);
616616

617+
commandStartTime = ustime();
618+
emit_system_free_memory();
619+
g_stats->timing("emit_free_system_memory_time_taken_us", ustime() - commandStartTime);
620+
617621
/* Log Keys */
618622
reply = RedisModule_Call(ctx, "dbsize", "");
619623
long long keys = RedisModule_CallReplyInteger(reply);
620624
RedisModule_FreeCallReply(reply);
621625
g_stats->gauge("keys", keys);
622626
RedisModule_Log(ctx, REDISMODULE_LOGLEVEL_DEBUG, "Emitting metric \"keys\": %llu", keys);
623627
g_stats->timing("metrics_time_taken_us", ustime() - startTime);
624-
625-
emit_system_free_memory();
626628

627629
lastTime = curTime;
628630
}

0 commit comments

Comments
 (0)