Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove the useless class table_stats #720

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix
  • Loading branch information
levy5307 committed Apr 15, 2021
commit 43d6631f6b4f4f30441ddec9345015380f267a38
10 changes: 5 additions & 5 deletions src/server/info_collector.cpp
Original file line number Diff line number Diff line change
@@ -149,24 +149,24 @@ void info_collector::on_app_stat()
return;
}

table_stats all_stats("_all_");
row_data all_stats("_all_");
for (const auto &app_rows : all_rows) {
// get statistics data for app
table_stats app_stats(app_rows.first);
row_data app_stats(app_rows.first);
for (auto partition_row : app_rows.second) {
app_stats.aggregate(partition_row);
}
get_app_counters(app_stats.app_name)->set(app_stats);
get_app_counters(app_stats.row_name)->set(app_stats);
// get row data statistics for all of the apps
all_stats.merge(app_stats);
all_stats.aggregate(app_stats);

// hotspot_partition_calculator is used for detecting hotspots
auto hotspot_partition_calculator =
get_hotspot_calculator(app_rows.first, app_rows.second.size());
hotspot_partition_calculator->data_aggregate(app_rows.second);
hotspot_partition_calculator->data_analyse();
}
get_app_counters(all_stats.app_name)->set(all_stats);
get_app_counters(all_stats.row_name)->set(all_stats);

ddebug_f("stat apps succeed, app_count = {}, total_read_qps = {}, total_write_qps = {}",
all_rows.size(),
102 changes: 47 additions & 55 deletions src/server/info_collector.h
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
#include <event2/bufferevent.h>

#include "../shell/commands.h"
#include "table_stats.h"

namespace pegasus {
namespace server {
@@ -51,65 +50,58 @@ class info_collector
return std::abs(total) < 1e-6 ? 0 : hit / total * 1e6;
}

void set(const table_stats &row_stats)
void set(const row_data &row_stats)
{
get_qps->set(row_stats.total_get_qps);
multi_get_qps->set(row_stats.total_multi_get_qps);
put_qps->set(row_stats.total_put_qps);
multi_put_qps->set(row_stats.total_multi_put_qps);
remove_qps->set(row_stats.total_remove_qps);
multi_remove_qps->set(row_stats.total_multi_remove_qps);
incr_qps->set(row_stats.total_incr_qps);
check_and_set_qps->set(row_stats.total_check_and_set_qps);
check_and_mutate_qps->set(row_stats.total_check_and_mutate_qps);
scan_qps->set(row_stats.total_scan_qps);
duplicate_qps->set(row_stats.total_duplicate_qps);
dup_shipped_ops->set(row_stats.total_dup_shipped_ops);
dup_failed_shipping_ops->set(row_stats.total_dup_failed_shipping_ops);
recent_read_cu->set(row_stats.total_recent_read_cu);
recent_write_cu->set(row_stats.total_recent_write_cu);
recent_expire_count->set(row_stats.total_recent_expire_count);
recent_filter_count->set(row_stats.total_recent_filter_count);
recent_abnormal_count->set(row_stats.total_recent_abnormal_count);
recent_write_throttling_delay_count->set(
row_stats.total_recent_write_throttling_delay_count);
get_qps->set(row_stats.get_qps);
multi_get_qps->set(row_stats.multi_get_qps);
put_qps->set(row_stats.put_qps);
multi_put_qps->set(row_stats.multi_put_qps);
remove_qps->set(row_stats.remove_qps);
multi_remove_qps->set(row_stats.multi_remove_qps);
incr_qps->set(row_stats.incr_qps);
check_and_set_qps->set(row_stats.check_and_set_qps);
check_and_mutate_qps->set(row_stats.check_and_mutate_qps);
scan_qps->set(row_stats.scan_qps);
duplicate_qps->set(row_stats.duplicate_qps);
dup_shipped_ops->set(row_stats.dup_shipped_ops);
dup_failed_shipping_ops->set(row_stats.dup_failed_shipping_ops);
recent_read_cu->set(row_stats.recent_read_cu);
recent_write_cu->set(row_stats.recent_write_cu);
recent_expire_count->set(row_stats.recent_expire_count);
recent_filter_count->set(row_stats.recent_filter_count);
recent_abnormal_count->set(row_stats.recent_abnormal_count);
recent_write_throttling_delay_count->set(row_stats.recent_write_throttling_delay_count);
recent_write_throttling_reject_count->set(
row_stats.total_recent_write_throttling_reject_count);
recent_read_throttling_delay_count->set(
row_stats.total_recent_read_throttling_delay_count);
recent_read_throttling_reject_count->set(
row_stats.total_recent_read_throttling_reject_count);
storage_mb->set(row_stats.total_storage_mb);
storage_count->set(row_stats.total_storage_count);
rdb_block_cache_hit_rate->set(
convert_to_1M_ratio(row_stats.total_rdb_block_cache_hit_count,
row_stats.total_rdb_block_cache_total_count));
row_stats.recent_write_throttling_reject_count);
recent_read_throttling_delay_count->set(row_stats.recent_read_throttling_delay_count);
recent_read_throttling_reject_count->set(row_stats.recent_read_throttling_reject_count);
storage_mb->set(row_stats.storage_mb);
storage_count->set(row_stats.storage_count);
rdb_block_cache_hit_rate->set(convert_to_1M_ratio(
row_stats.rdb_block_cache_hit_count, row_stats.rdb_block_cache_total_count));
rdb_index_and_filter_blocks_mem_usage->set(
row_stats.total_rdb_index_and_filter_blocks_mem_usage);
rdb_memtable_mem_usage->set(row_stats.total_rdb_memtable_mem_usage);
rdb_estimate_num_keys->set(row_stats.total_rdb_estimate_num_keys);
rdb_bf_seek_negatives_rate->set(convert_to_1M_ratio(
row_stats.total_rdb_bf_seek_negatives, row_stats.total_rdb_bf_seek_total));
rdb_bf_point_negatives_rate->set(
convert_to_1M_ratio(row_stats.total_rdb_bf_point_negatives,
row_stats.total_rdb_bf_point_negatives +
row_stats.total_rdb_bf_point_positive_total));
rdb_bf_point_false_positive_rate->set(
convert_to_1M_ratio(row_stats.total_rdb_bf_point_positive_total -
row_stats.total_rdb_bf_point_positive_true,
(row_stats.total_rdb_bf_point_positive_total -
row_stats.total_rdb_bf_point_positive_true) +
row_stats.total_rdb_bf_point_negatives));
row_stats.rdb_index_and_filter_blocks_mem_usage);
rdb_memtable_mem_usage->set(row_stats.rdb_memtable_mem_usage);
rdb_estimate_num_keys->set(row_stats.rdb_estimate_num_keys);
rdb_bf_seek_negatives_rate->set(
convert_to_1M_ratio(row_stats.rdb_bf_seek_negatives, row_stats.rdb_bf_seek_total));
rdb_bf_point_negatives_rate->set(convert_to_1M_ratio(
row_stats.rdb_bf_point_negatives,
row_stats.rdb_bf_point_negatives + row_stats.rdb_bf_point_positive_total));
rdb_bf_point_false_positive_rate->set(convert_to_1M_ratio(
row_stats.rdb_bf_point_positive_total - row_stats.rdb_bf_point_positive_true,
(row_stats.rdb_bf_point_positive_total - row_stats.rdb_bf_point_positive_true) +
row_stats.rdb_bf_point_negatives));
read_qps->set(row_stats.get_total_read_qps());
write_qps->set(row_stats.get_total_write_qps());
backup_request_qps->set(row_stats.total_backup_request_qps);
get_bytes->set(row_stats.total_get_bytes);
multi_get_bytes->set(row_stats.total_multi_get_bytes);
scan_bytes->set(row_stats.total_scan_bytes);
put_bytes->set(row_stats.total_put_bytes);
multi_put_bytes->set(row_stats.total_multi_put_bytes);
check_and_set_bytes->set(row_stats.total_check_and_set_bytes);
check_and_mutate_bytes->set(row_stats.total_check_and_mutate_bytes);
backup_request_qps->set(row_stats.backup_request_qps);
get_bytes->set(row_stats.get_bytes);
multi_get_bytes->set(row_stats.multi_get_bytes);
scan_bytes->set(row_stats.scan_bytes);
put_bytes->set(row_stats.put_bytes);
multi_put_bytes->set(row_stats.multi_put_bytes);
check_and_set_bytes->set(row_stats.check_and_set_bytes);
check_and_mutate_bytes->set(row_stats.check_and_mutate_bytes);
read_bytes->set(row_stats.get_total_read_bytes());
write_bytes->set(row_stats.get_total_write_bytes());
}
195 changes: 0 additions & 195 deletions src/server/table_stats.h

This file was deleted.

Loading