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

fix(collector): fix unexpected crash #984

Merged
merged 3 commits into from
May 29, 2022
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
4 changes: 2 additions & 2 deletions src/server/hotspot_partition_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ void hotspot_partition_calculator::init_perf_counter(int partition_count)
void hotspot_partition_calculator::stat_histories_analyse(uint32_t data_type,
std::vector<int> &hot_points)
{
int hot_point_size = _hot_points.size();
hot_points.assign(hot_point_size, 0);
double table_qps_sum = 0, standard_deviation = 0, table_qps_avg = 0;
int sample_count = 0;
for (const auto &one_partition_stat_histories : _partitions_stat_histories) {
Expand All @@ -116,8 +118,6 @@ void hotspot_partition_calculator::stat_histories_analyse(uint32_t data_type,
}
standard_deviation = sqrt(standard_deviation / (sample_count - 1));
const auto &anly_data = _partitions_stat_histories.back();
int hot_point_size = _hot_points.size();
hot_points.resize(hot_point_size);
for (int i = 0; i < hot_point_size; i++) {
double hot_point = 0;
if (standard_deviation != 0) {
Expand Down