MCPcopy Create free account
hub / github.com/F-Stack/f-stack / updateStatsOnUnblock

Function updateStatsOnUnblock

app/redis-6.2.6/src/blocked.c:111–119  ·  view source on GitHub ↗

This function is called after a client has finished a blocking operation * in order to update the total command duration, log the command into * the Slow log if needed, and log the reply duration event if needed. */

Source from the content-addressed store, hash-verified

109 * in order to update the total command duration, log the command into
110 * the Slow log if needed, and log the reply duration event if needed. */
111void updateStatsOnUnblock(client *c, long blocked_us, long reply_us){
112 const ustime_t total_cmd_duration = c->duration + blocked_us + reply_us;
113 c->lastcmd->microseconds += total_cmd_duration;
114
115 /* Log the command into the Slow log if needed. */
116 slowlogPushCurrentCommand(c, c->lastcmd, total_cmd_duration);
117 /* Log the reply duration event. */
118 latencyAddSampleIfNeeded("command-unblocking",reply_us/1000);
119}
120
121/* This function is called in the beforeSleep() function of the event loop
122 * in order to process the pending input buffer of clients that were

Calls 1

Tested by

no test coverage detected