summaryrefslogtreecommitdiff
path: root/src/latency.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/latency.h')
-rw-r--r--src/latency.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/latency.h b/src/latency.h
index 6f2a854dc..13503d5c0 100644
--- a/src/latency.h
+++ b/src/latency.h
@@ -89,4 +89,20 @@ void latencyAddSample(const char *event, mstime_t latency);
#define latencyRemoveNestedEvent(event_var,nested_var) \
event_var += nested_var;
+typedef struct durationStats {
+ unsigned long long cnt;
+ unsigned long long sum;
+ unsigned long long max;
+} durationStats;
+
+typedef enum {
+ EL_DURATION_TYPE_EL = 0, // cumulative time duration metric of the whole eventloop
+ EL_DURATION_TYPE_CMD, // cumulative time duration metric of executing commands
+ EL_DURATION_TYPE_AOF, // cumulative time duration metric of flushing AOF in eventloop
+ EL_DURATION_TYPE_CRON, // cumulative time duration metric of cron (serverCron and beforeSleep, but excluding IO and AOF)
+ EL_DURATION_TYPE_NUM
+} DurationType;
+
+void durationAddSample(int type, monotime duration);
+
#endif /* __LATENCY_H */