Skip to content

Commit 43d16c9

Browse files
authored
Slowlog implementation - cherry pick (#886)
* Slowlog implementation (#883) * added slowlog timer implementation and updated redismodule.h file * added test for slowlog timer implementation * replaced time_ns() with time() for python <3.7 compatibility * splited asserts for better error catching * instead of assuming last command was DAGEXECUTE, search for the command in the last 10 commands * Added a wrapper for skipping test by redis version improved test_slowlog_time_dag_modelexecute_financialNet_autobatch test * added a check for version before using RedisModule_BlockedClientMeasureTime functions (supported from version 6.2) * Review fixes: Added 'patch' argument for skip_if_not_version command. Added comments in test_slowlog_time_dag_modelexecute_financialNet_autobatch test. * Valgring test will run on 6.0 redis, until additional support will be added * Slowlog impl fix (#885) * fix for circleci valgrind-cluster test: uses 6.2.5-x64-bullseye again * fix the debug messege: will display the test-function name now * update valgrind test to 6.2
1 parent 712e013 commit 43d16c9

File tree

5 files changed

+284
-10
lines changed

5 files changed

+284
-10
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ commands:
176176
- run:
177177
name: Install dependencies
178178
command: |
179-
./opt/readies/bin/getredis -v 6.0 --valgrind --force
179+
./opt/readies/bin/getredis -v 6.2 --valgrind --force
180180
./get_deps.sh cpu
181181
- run:
182182
name: Build for valgrind
@@ -359,7 +359,7 @@ jobs:
359359
- run:
360360
name: Install dependencies
361361
command: |
362-
./opt/readies/bin/getredis -v 6.0 --valgrind --force
362+
./opt/readies/bin/getredis -v 6.2 --valgrind --force
363363
./get_deps.sh cpu
364364
- run:
365365
name: Build for valgrind

src/execution/DAG/dag.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ void RedisAI_BatchedDagRunSession_ModelRun_Step(RedisAI_RunInfo **batched_rinfo,
210210
}
211211

212212
RAI_Error err = {0};
213-
RAI_Model *model = RAI_ModelRunCtxGetModel((RAI_ModelRunCtx *)ectxs[0]);
214213
const long long start = ustime();
215214
int result = RAI_ModelRun((RAI_ModelRunCtx **)ectxs, n_rinfo, &err);
216215
const long long end = ustime();
@@ -686,6 +685,10 @@ void DAG_ReplyAndUnblock(RedisAI_OnFinishCtx *ctx, void *private_data) {
686685

687686
RedisAI_RunInfo *rinfo = (RedisAI_RunInfo *)ctx;
688687
if (rinfo->client) {
688+
if (RedisModule_GetServerVersion() >=
689+
0x060200) { // The following command is supported only from redis 6.2
690+
RedisModule_BlockedClientMeasureTimeEnd(rinfo->client);
691+
}
689692
RedisModule_UnblockClient(rinfo->client, rinfo);
690693
}
691694
}

src/execution/command_parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ int RedisAI_ExecuteCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int ar
7171
RedisModule_UnblockClient(rinfo->client, rinfo);
7272
return REDISMODULE_ERR;
7373
}
74+
if (RedisModule_GetServerVersion() >=
75+
0x060200) { // The following command is supported only from redis 6.2
76+
RedisModule_BlockedClientMeasureTimeStart(rinfo->client);
77+
}
7478
return REDISMODULE_OK;
7579
}

0 commit comments

Comments
 (0)