mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Fix the heap collecting values
This PR fixes an issue where the max heap size was reported as the double of the actual value because it was merging the values of the usage.max and peak.max into a single value. Fixes: #6608 Fixes #6827
This commit is contained in:
parent
a552214fa1
commit
68151c894a
1 changed files with 12 additions and 5 deletions
|
@ -161,14 +161,21 @@ module LogStash module Instrument module PeriodicPoller
|
|||
end
|
||||
|
||||
def aggregate_information_for(collection)
|
||||
transpose_map = {
|
||||
"usage.used" => :used_in_bytes,
|
||||
"usage.committed" => :committed_in_bytes,
|
||||
"usage.max" => :max_in_bytes,
|
||||
"peak.max" => :peak_max_in_bytes,
|
||||
"peak.used" => :peak_used_in_bytes
|
||||
|
||||
}
|
||||
collection.reduce(default_information_accumulator) do |m,e|
|
||||
e = { e[0] => e[1] } if e.is_a?(Array)
|
||||
e.each_pair do |k,v|
|
||||
m[:used_in_bytes] += v if k.include?("used")
|
||||
m[:committed_in_bytes] += v if k.include?("committed")
|
||||
m[:max_in_bytes] += v if k.include?("max")
|
||||
m[:peak_max_in_bytes] += v if k.include?("peak.max")
|
||||
m[:peak_used_in_bytes] += v if k.include?("peak.used")
|
||||
if transpose_map.include?(k)
|
||||
transpose_key = transpose_map[k]
|
||||
m[transpose_key] += v
|
||||
end
|
||||
end
|
||||
m
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue