Class MemoryPoolsExports
Example usage:
new MemoryPoolsExports().register();
Example metrics being exported:
jvm_memory_bytes_used{area="heap"} 2000000
jvm_memory_bytes_committed{area="nonheap"} 200000
jvm_memory_bytes_max{area="nonheap"} 2000000
jvm_memory_pool_bytes_used{pool="PS Eden Space"} 2000
-
Nested Class Summary
Nested classes/interfaces inherited from class Collector
Collector.Describable, Collector.MetricFamilySamples, Collector.Type -
Field Summary
Fields inherited from class Collector
MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND -
Constructor Summary
ConstructorsConstructorDescriptionMemoryPoolsExports(MemoryMXBean memoryBean, List<MemoryPoolMXBean> poolBeans) -
Method Summary
Modifier and TypeMethodDescriptioncollect()Return all metrics of this Collector.LikeCollector.collect(), but the result should only containMetricFamilySampleswheresampleNameFilter.test(name)istruefor at least one Sample name.Methods inherited from class Collector
checkMetricLabelName, checkMetricName, doubleToGoString, register, register, sanitizeMetricName
-
Constructor Details
-
MemoryPoolsExports
public MemoryPoolsExports() -
MemoryPoolsExports
-
-
Method Details
-
collect
Description copied from class:CollectorReturn all metrics of this Collector. -
collect
Description copied from class:CollectorLikeCollector.collect(), but the result should only containMetricFamilySampleswheresampleNameFilter.test(name)istruefor at least one Sample name.The default implementation first collects all
MetricFamilySamplesand then discards the ones wheresampleNameFilter.test(name)returnsfalsefor all names inCollector.MetricFamilySamples.getNames(). To improve performance, collector implementations should override this method to preventMetricFamilySamplesfrom being collected if they will be discarded anyways. SeeThreadExportsfor an example.Note that the resulting List may contain
MetricFamilySampleswhere some Sample names returntrueforsampleNameFilter.test(name)but some Sample names returnfalse. This is ok, because before we produce the output format we will callCollector.MetricFamilySamples.filter(Predicate)to strip all Samples wheresampleNameFilter.test(name)returnsfalse.
-