Skip to content

Commit c8a2757

Browse files
committed
[fix] Fixed BG thread CPU percentage conversion (we were converting from nsec to ms and it's supposed to be from nsec to micros )
1 parent 3da867b commit c8a2757

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/redisai.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ void RAI_moduleInfoFunc(RedisModuleInfoCtx *ctx, int for_crash_report) {
10521052
struct timespec ts;
10531053
clockid_t cid;
10541054
sds queue_used_cpu_total = sdscatprintf(
1055-
sdsempty(), "queue_%s_bthread_#%d_used_cpu_total", queue_name, i + 1);
1055+
sdsempty(), "queue_%s_bthread_n%d_used_cpu_total", queue_name, i + 1);
10561056
sds bthread_used_cpu_total = sdsempty();
10571057
#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) || \
10581058
defined(__cplusplus)
@@ -1068,7 +1068,7 @@ void RAI_moduleInfoFunc(RedisModuleInfoCtx *ctx, int for_crash_report) {
10681068
} else {
10691069
bthread_used_cpu_total =
10701070
sdscatprintf(bthread_used_cpu_total, "%ld.%06ld", (long)ts.tv_sec,
1071-
(long)(ts.tv_nsec / 1000000));
1071+
(long)(ts.tv_nsec / 1000));
10721072
}
10731073
}
10741074
RedisModule_InfoAddFieldCString(ctx, queue_used_cpu_total, bthread_used_cpu_total);

0 commit comments

Comments
 (0)