aboutsummaryrefslogtreecommitdiff
path: root/examples/redis-unstable/src/slowlog.h
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-21 22:40:55 +0100
commit5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda (patch)
tree1acdfa5220cd13b7be43a2a01368e80d306473ca /examples/redis-unstable/src/slowlog.h
parentc7ab12bba64d9c20ccd79b132dac475f7bc3923e (diff)
downloadcrep-5d8dfe892a2ea89f706ee140c3bdcfd89fe03fda.tar.gz
Add Redis source code for testing
Diffstat (limited to 'examples/redis-unstable/src/slowlog.h')
-rw-r--r--examples/redis-unstable/src/slowlog.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/redis-unstable/src/slowlog.h b/examples/redis-unstable/src/slowlog.h
new file mode 100644
index 0000000..2e28420
--- /dev/null
+++ b/examples/redis-unstable/src/slowlog.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright (c) 2009-Present, Redis Ltd.
3 * All rights reserved.
4 *
5 * Licensed under your choice of (a) the Redis Source Available License 2.0
6 * (RSALv2); or (b) the Server Side Public License v1 (SSPLv1); or (c) the
7 * GNU Affero General Public License v3 (AGPLv3).
8 */
9
10#ifndef __SLOWLOG_H__
11#define __SLOWLOG_H__
12
13#define SLOWLOG_ENTRY_MAX_ARGC 32
14#define SLOWLOG_ENTRY_MAX_STRING 128
15
16/* This structure defines an entry inside the slow log list */
17typedef struct slowlogEntry {
18 robj **argv;
19 int argc;
20 long long id; /* Unique entry identifier. */
21 long long duration; /* Time spent by the query, in microseconds. */
22 time_t time; /* Unix time at which the query was executed. */
23 sds cname; /* Client name. */
24 sds peerid; /* Client network address. */
25} slowlogEntry;
26
27/* Exported API */
28void slowlogInit(void);
29void slowlogPushEntryIfNeeded(client *c, robj **argv, int argc, long long duration);
30
31#endif /* __SLOWLOG_H__ */