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

Function latencyResetEvent

app/redis-6.2.6/src/latency.c:152–168  ·  view source on GitHub ↗

Reset data for the specified event, or all the events data if 'event' is * NULL. * * Note: this is O(N) even when event_to_reset is not NULL because makes * the code simpler and we have a small fixed max number of events. */

Source from the content-addressed store, hash-verified

150 * Note: this is O(N) even when event_to_reset is not NULL because makes
151 * the code simpler and we have a small fixed max number of events. */
152int latencyResetEvent(char *event_to_reset) {
153 dictIterator *di;
154 dictEntry *de;
155 int resets = 0;
156
157 di = dictGetSafeIterator(server.latency_events);
158 while((de = dictNext(di)) != NULL) {
159 char *event = dictGetKey(de);
160
161 if (event_to_reset == NULL || strcasecmp(event,event_to_reset) == 0) {
162 dictDelete(server.latency_events, event);
163 resets++;
164 }
165 }
166 dictReleaseIterator(di);
167 return resets;
168}
169
170/* ------------------------ Latency reporting (doctor) ---------------------- */
171

Callers 1

latencyCommandFunction · 0.85

Calls 5

dictGetSafeIteratorFunction · 0.85
strcasecmpFunction · 0.85
dictNextFunction · 0.70
dictDeleteFunction · 0.70
dictReleaseIteratorFunction · 0.70

Tested by

no test coverage detected