Sentinel
Sentinel copied to clipboard
Improve performance of StatisticNode#metrics. issue 1171
Describe what this PR does / why we need it Every second Sentinel will aggregate metrics of every resource and write to the metric log, but when aggregating the metric of last second, it actually generates metric items in the past minute , which is not necessary.
Does this pull request fix one issue? issue 1171
Describe how you did it I modified StatisticNode#metrics. It only aggregates the metrics within flush interval. It would be reduce unnecessary metric items
Describe how to verify it Verify the function by running the unit test in StatisticNodeTests#testMetrics
Special notes for reviews