class MachineMetricFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
MachineMetricFactory.MetricValues |
Modifier and Type | Field and Description |
---|---|
private static java.util.List<MachineMetric> |
fdMetrics |
private JmxInfoProvider |
jmxInfoProvider |
private static java.util.List<MachineMetric> |
memoryMetrics |
private static java.util.List<MachineMetric> |
threadMetrics |
Constructor and Description |
---|
MachineMetricFactory() |
Modifier and Type | Method and Description |
---|---|
private void |
addFileDescriptorMetrics(java.util.List<MetricDatum> targetList,
java.util.Set<MachineMetric> customSet) |
private void |
addMemoryMetrics(java.util.List<MetricDatum> targetList,
java.util.Set<MachineMetric> customSet) |
private void |
addMetrics(java.util.List<MetricDatum> list,
MachineMetricFactory.MetricValues metricValues,
StandardUnit unit)
Add the given list of metrics and corresponding values specified in
"metricValues" to the given list of metric datum.
|
private void |
addThreadMetrics(java.util.List<MetricDatum> targetList,
java.util.Set<MachineMetric> customSet) |
private java.util.Set<MachineMetric> |
customMachineMetrics()
Returns the set of custom machine metrics specified in the SDK metrics
registry; or an empty set if there is none.
|
private MachineMetricFactory.MetricValues |
fdMetricValues(java.util.Set<MachineMetric> customSet,
java.util.List<java.lang.Long> values)
Returns the set of file-descriptor metrics and the corresponding values based on
the default and the customized set of metrics, if any.
|
(package private) java.util.List<MetricDatum> |
generateMetrics() |
private MachineMetricFactory.MetricValues |
memoryMetricValues(java.util.Set<MachineMetric> customSet,
java.util.List<java.lang.Long> values)
Returns the set of memory metrics and the corresponding values based on
the default and the customized set of metrics, if any.
|
private MachineMetricFactory.MetricValues |
metricValues(java.util.Set<MachineMetric> customSet,
java.util.List<MachineMetric> defaults,
java.util.List<java.lang.Long> values)
Returns a subset of the given list of metrics in "defaults" and the
corresponding value of each returned metric in the subset.
|
private MachineMetricFactory.MetricValues |
threadMetricValues(java.util.Set<MachineMetric> customSet,
java.util.List<java.lang.Long> values)
Returns the set of thread metrics and the corresponding values based on
the default and the customized set of metrics, if any.
|
private static final java.util.List<MachineMetric> memoryMetrics
private static final java.util.List<MachineMetric> threadMetrics
private static final java.util.List<MachineMetric> fdMetrics
private final JmxInfoProvider jmxInfoProvider
private void addMetrics(java.util.List<MetricDatum> list, MachineMetricFactory.MetricValues metricValues, StandardUnit unit)
list
- list of metric datametricValues
- list of metrics and their corresponding valuesprivate java.util.Set<MachineMetric> customMachineMetrics()
private MachineMetricFactory.MetricValues metricValues(java.util.Set<MachineMetric> customSet, java.util.List<MachineMetric> defaults, java.util.List<java.lang.Long> values)
customSet
- custom machine metrics specified in the SDK metrics registrydefaults
- the given default list of metricsvalues
- corresponding values of each metric in "defaults"java.util.List<MetricDatum> generateMetrics()
private void addMemoryMetrics(java.util.List<MetricDatum> targetList, java.util.Set<MachineMetric> customSet)
private void addFileDescriptorMetrics(java.util.List<MetricDatum> targetList, java.util.Set<MachineMetric> customSet)
private void addThreadMetrics(java.util.List<MetricDatum> targetList, java.util.Set<MachineMetric> customSet)
private MachineMetricFactory.MetricValues memoryMetricValues(java.util.Set<MachineMetric> customSet, java.util.List<java.lang.Long> values)
customSet
- a non-null customized set of metricsvalues
- a non-null list of values corresponding to the list of default
memory metricsprivate MachineMetricFactory.MetricValues fdMetricValues(java.util.Set<MachineMetric> customSet, java.util.List<java.lang.Long> values)
customSet
- a non-null customized set of metricsvalues
- a non-null list of values corresponding to the list of default
file-descriptor metricsprivate MachineMetricFactory.MetricValues threadMetricValues(java.util.Set<MachineMetric> customSet, java.util.List<java.lang.Long> values)
customSet
- a non-null customized set of metricsvalues
- a non-null list of values corresponding to the list of default
thread metrics