-
Notifications
You must be signed in to change notification settings - Fork 312
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
feat(collector): add statistics for partition hotspot #444
Merged
+372
−86
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acelyc111
previously approved these changes
Feb 17, 2020
levy5307
reviewed
Feb 17, 2020
levy5307
approved these changes
Feb 17, 2020
acelyc111
approved these changes
Feb 17, 2020
This was referenced Feb 18, 2020
Closed
Closed
neverchanje
added
type/config-change
Added or modified configuration that should be noted on release note of new version.
and removed
type/config-change
Added or modified configuration that should be noted on release note of new version.
labels
Mar 31, 2020
neverchanje
pushed a commit
that referenced
this pull request
Mar 31, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add statistics for partition hotspot
1 Background
At present, Pegasus lists the monitoring values for hotspot detection primitively, using manual methods for fault detection and troubleshooting, which is cumbersome for operation and maintenance. In order to make the data more visually presented, we have added a hotspot detection module, which scores relevant values of hotspot issues and feeds them back to falcon, reducing the burden on workload of operation and maintenance.
The function of this module is to collect partition-level information in real time, and calculate the hotspot value of each partition according to the corresponding algorithm and feed it back to falcon. Through the change curve of the hotspot value of each partition, operation and maintenance personnel can more quickly infer the location of the hotspot.
At the same time, this work is also one of the solutions for hot data reading and writing problems.
2 Algorithm Framework
2.1 Relationship
In info_collector.cpp, each app's relative data will be collected according to the configuration of
_app_stat_interval_seconds
(the default interval is 10s).2.2 Data Structure
2.2.1 Database Level
Using
map<string, hotspot_calculator *> _hotspot_calculator_store
holds all the hotpot_calculator pointers of the application, and uses the corresponding algorithm and data to perform operations when traversing the app.2.2.2 App Level
For each app, there is a hotpot_calculator:
_app_name
is the name of the app,_policy
is the algorithm we select to use,_points
is the hotspot point we calculate and feed back to perf_counter._app_data
saves historical data of each partition in this app. And we use queue to save the space, which allows use saving 100 historical data.2.2.3 Paritition Level
std::queue<std::vector<hotspot_partition_data>> _app_data;
vector is used to save the partitions' data of this app, hotspot_partition_data is used to save data of one partition
Currently our algorithm use these data of partition to calculate.
2.2.4 Class Diagram
2.3 Demo
2.4 New perf-counter: