Add GC Strategy under /note/jvm

Fixes: #5755

Fixes #5775
This commit is contained in:
Pier-Hugues Pellerin 2016-08-17 15:44:17 -04:00
parent 59bc304f27
commit 226c51ca0e
2 changed files with 5 additions and 3 deletions

View file

@ -35,6 +35,7 @@ module LogStash
def jvm
memory_bean = ManagementFactory.getMemoryMXBean()
{
:pid => ManagementFactory.getRuntimeMXBean().getName().split("@").first.to_i,
:version => java.lang.System.getProperty("java.version"),
@ -48,14 +49,14 @@ module LogStash
:heap_max_in_bytes => (memory_bean.getHeapMemoryUsage().getMax() < 0 ? 0 : memory_bean.getHeapMemoryUsage().getMax()),
:non_heap_init_in_bytes => (memory_bean.getNonHeapMemoryUsage().getInit() < 0 ? 0 : memory_bean.getNonHeapMemoryUsage().getInit()),
:non_heap_max_in_bytes => (memory_bean.getNonHeapMemoryUsage().getMax() < 0 ? 0 : memory_bean.getNonHeapMemoryUsage().getMax())
}
},
:gc_collectors => ManagementFactory.getGarbageCollectorMXBeans().collect(&:getName)
}
end
def hot_threads(options={})
HotThreadsReport.new(self, options)
end
end
end
end

View file

@ -82,7 +82,8 @@ describe LogStash::Api::Modules::Node do
"heap_max_in_bytes" => Numeric,
"non_heap_init_in_bytes" => Numeric,
"non_heap_max_in_bytes" => Numeric
}
},
"gc_collectors" => Array
},
"hot_threads"=> {
"time" => String,