Memtiter-benchmark源码解析4--clients.cpp, run_stats.cpp, shard_connections联合统计latency

run_stats_types.h

run_stats_types 包含了几个统计latency重要的类
在这里插入图片描述

在这里插入图片描述

one_sec_cmd_stats

在这里插入图片描述

shard_connection.cpp send a set command

在这里插入图片描述

class run_stats

run_stats.h

Important members:
one_second_stats m_cur_stats; // current second stats (appended to m_stats and reset every second)
totals m_totals; // the final statistics of latency
instantaneous command stats (used in the per second latencies)

inst_m_get_latency_histogram;

在这里插入图片描述

How to record the latency for each request?

Each client has a proteced member call m_stats which is an instance of class run_stats.
在这里插入图片描述
In the handle_response function at Client.cpp, the client calls the update_set_op funcion of m_stats to collect the latency for a request (Line 391).

接博客末尾 Memtiter-benchmark源码解析2–shard_connection
At client.cpp
在这里插入图片描述
At Line 393, we can see that the latency of a request is equal to the difference between a request’s sent time and its reponse’s recieved time.
在这里插入图片描述

client invokes the update_set_op funcion of a run_stats.

Then a run_stats calls the corresponding functions to record the latency.

在这里插入图片描述

Finally, we call the global hdr_record_value funcion in hdr_historgram.h to record the latency for each request at Line 190.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值