summaryrefslogtreecommitdiff
path: root/src/latency.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-11-30 17:10:51 +0100
committerantirez <antirez@gmail.com>2019-01-09 17:00:29 +0100
commit920611a4197cd2606504e6ce4bf66ee213c76b36 (patch)
tree73ef453e06976797d939dcb14e8f2411608df69a /src/latency.c
parentddb98ad56f9e9eb658f79ee8faf2b027e97c0af7 (diff)
downloadredis-920611a4197cd2606504e6ce4bf66ee213c76b36.tar.gz
RESP3: latency.c updated.
Diffstat (limited to 'src/latency.c')
-rw-r--r--src/latency.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/latency.c b/src/latency.c
index 97e6a702e..33aa1245b 100644
--- a/src/latency.c
+++ b/src/latency.c
@@ -476,19 +476,19 @@ sds createLatencyReport(void) {
/* latencyCommand() helper to produce a time-delay reply for all the samples
* in memory for the specified time series. */
void latencyCommandReplyWithSamples(client *c, struct latencyTimeSeries *ts) {
- void *replylen = addDeferredMultiBulkLength(c);
+ void *replylen = addReplyDeferredLen(c);
int samples = 0, j;
for (j = 0; j < LATENCY_TS_LEN; j++) {
int i = (ts->idx + j) % LATENCY_TS_LEN;
if (ts->samples[i].time == 0) continue;
- addReplyMultiBulkLen(c,2);
+ addReplyArrayLen(c,2);
addReplyLongLong(c,ts->samples[i].time);
addReplyLongLong(c,ts->samples[i].latency);
samples++;
}
- setDeferredMultiBulkLength(c,replylen,samples);
+ setDeferredArrayLen(c,replylen,samples);
}
/* latencyCommand() helper to produce the reply for the LATEST subcommand,
@@ -497,14 +497,14 @@ void latencyCommandReplyWithLatestEvents(client *c) {
dictIterator *di;
dictEntry *de;
- addReplyMultiBulkLen(c,dictSize(server.latency_events));
+ addReplyArrayLen(c,dictSize(server.latency_events));
di = dictGetIterator(server.latency_events);
while((de = dictNext(di)) != NULL) {
char *event = dictGetKey(de);
struct latencyTimeSeries *ts = dictGetVal(de);
int last = (ts->idx + LATENCY_TS_LEN - 1) % LATENCY_TS_LEN;
- addReplyMultiBulkLen(c,4);
+ addReplyArrayLen(c,4);
addReplyBulkCString(c,event);
addReplyLongLong(c,ts->samples[last].time);
addReplyLongLong(c,ts->samples[last].latency);
@@ -583,7 +583,7 @@ NULL
/* LATENCY HISTORY <event> */
ts = dictFetchValue(server.latency_events,c->argv[2]->ptr);
if (ts == NULL) {
- addReplyMultiBulkLen(c,0);
+ addReplyArrayLen(c,0);
} else {
latencyCommandReplyWithSamples(c,ts);
}