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. */
| 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. */ |
| 152 | int 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 |
no test coverage detected