Skip to content

Commit

Permalink
List ingress and egress separately on JSON and CSV exports. Include B…
Browse files Browse the repository at this point in the history
…W and also raw values per second
  • Loading branch information
filipecosta90 committed Dec 21, 2023
1 parent e08d4cf commit 4dcc7cd
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 86 deletions.
9 changes: 6 additions & 3 deletions client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,16 @@ void client::handle_response(unsigned int conn_id, struct timeval timestamp,
switch (request->m_type) {
case rt_get:
m_stats.update_get_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp),
response->get_hits(),
request->m_keys - response->get_hits());
break;
case rt_set:
m_stats.update_set_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp));
break;
case rt_wait:
Expand All @@ -462,7 +464,8 @@ void client::handle_response(unsigned int conn_id, struct timeval timestamp,
case rt_arbitrary: {
arbitrary_request *ar = static_cast<arbitrary_request *>(request);
m_stats.update_arbitrary_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp),
ar->index);
break;
Expand Down
18 changes: 12 additions & 6 deletions cluster_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,19 @@ void cluster_client::handle_moved(unsigned int conn_id, struct timeval timestamp
// update stats
if (request->m_type == rt_get) {
m_stats.update_moved_get_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp));
} else if (request->m_type == rt_set) {
m_stats.update_moved_set_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp));
} else if (request->m_type == rt_arbitrary) {
arbitrary_request *ar = static_cast<arbitrary_request *>(request);
m_stats.update_moved_arbitrary_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp),
ar->index);
} else {
Expand All @@ -452,16 +455,19 @@ void cluster_client::handle_ask(unsigned int conn_id, struct timeval timestamp,
// update stats
if (request->m_type == rt_get) {
m_stats.update_ask_get_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp));
} else if (request->m_type == rt_set) {
m_stats.update_ask_set_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp));
} else if (request->m_type == rt_arbitrary) {
arbitrary_request *ar = static_cast<arbitrary_request *>(request);
m_stats.update_ask_arbitrary_op(&timestamp,
request->m_size + response->get_total_len(),
response->get_total_len(),
request->m_size,
ts_diff(request->m_sent_time, timestamp),
ar->index);
} else {
Expand Down
Loading

0 comments on commit 4dcc7cd

Please sign in to comment.