Skip to content

Commit

Permalink
clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Smityz committed Dec 16, 2019
1 parent e7064be commit 0c374c1
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 209 deletions.
2 changes: 0 additions & 2 deletions src/server/info_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ info_collector::AppStatCounters *info_collector::get_app_counters(const std::str
INIT_COUNTER(rdb_memtable_mem_usage);
INIT_COUNTER(read_qps);
INIT_COUNTER(write_qps);
INIT_COUNTER(qps_max_min_scale);
INIT_COUNTER(cu_max_min_scale);
_app_stat_counters[app_name] = counters;
return counters;
}
Expand Down
57 changes: 0 additions & 57 deletions src/server/info_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,18 @@
#include <fstream>

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

namespace pegasus {
namespace server {

class result_writer;
static const int HOTSPOT_MAX_MIN_SCALE_THRESHOLD = 10;

class info_collector
{
public:
struct AppStatCounters
{
void set(const table_stats &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);
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);
recent_write_throttling_reject_count->set(
row_stats.total_recent_write_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(
std::abs(row_stats.total_rdb_block_cache_total_count) < 1e-6
? 0
: row_stats.total_rdb_block_cache_hit_count /
row_stats.total_rdb_block_cache_total_count * 1000000);
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);
read_qps->set(row_stats.get_total_read_qps());
write_qps->set(row_stats.get_total_write_qps());

double qps_scale = row_stats.max_total_qps / std::max(row_stats.min_total_qps, 1.0);
double cu_scale = row_stats.max_total_cu / std::max(row_stats.min_total_cu, 1.0);
qps_max_min_scale->set(qps_scale);
cu_max_min_scale->set(cu_scale);
if (qps_scale >= HOTSPOT_MAX_MIN_SCALE_THRESHOLD) {
ddebug(
"There is a hot spot about qps in app %s(partition id: %s), max/min scale=%d",
row_stats.app_name.c_str(),
row_stats.max_qps_partition_id.c_str(),
qps_scale);
}
if (cu_scale >= HOTSPOT_MAX_MIN_SCALE_THRESHOLD) {
ddebug("There is a hot spot about cu in app %s(partition id: %s), max/min scale=%d",
row_stats.app_name.c_str(),
row_stats.max_cu_partition_id.c_str(),
cu_scale);
}
}

::dsn::perf_counter_wrapper get_qps;
::dsn::perf_counter_wrapper multi_get_qps;
::dsn::perf_counter_wrapper put_qps;
Expand All @@ -110,8 +55,6 @@ class info_collector
::dsn::perf_counter_wrapper rdb_memtable_mem_usage;
::dsn::perf_counter_wrapper read_qps;
::dsn::perf_counter_wrapper write_qps;
::dsn::perf_counter_wrapper qps_max_min_scale;
::dsn::perf_counter_wrapper cu_max_min_scale;
};

info_collector();
Expand Down
142 changes: 0 additions & 142 deletions src/server/table_stats.h

This file was deleted.

8 changes: 0 additions & 8 deletions src/shell/command_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,6 @@ inline bool parse_app_pegasus_perf_counter_name(const std::string &name,

struct row_data
{
double get_total_qps() const
{
return get_qps + multi_get_qps + scan_qps + put_qps + multi_put_qps + remove_qps +
multi_remove_qps + incr_qps + check_and_set_qps + check_and_mutate_qps;
}

double get_total_cu() const { return recent_read_cu + recent_write_cu; }

std::string row_name;
int32_t app_id = 0;
int32_t partition_count = 0;
Expand Down

0 comments on commit 0c374c1

Please sign in to comment.