public class Component extends Object implements NamedResource
Modifier and Type | Class and Description |
---|---|
static class |
Component.Builder
Builder to make plugin data construction easier.
|
Constructor and Description |
---|
Component()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetric(String name,
double value)
Adds a floating-point metric to the set of metrics.
|
void |
addMetric(String name,
double[] values)
Adds a floating-point metric to the set of metrics.
|
void |
addMetric(String name,
int value)
Adds an integer metric to the set of metrics.
|
void |
addMetric(String name,
int[] values)
Adds an integer metric to the set of metrics.
|
<T> void |
addMetric(String name,
MetricTimeslice<T> timeslice)
Adds a metric to the set of metrics.
|
static Component.Builder |
builder()
Returns a builder for the plugin component.
|
int |
getDuration()
Returns the duration over which the metric data was collected (in seconds).
|
String |
getGuid()
Returns the guid of the component.
|
Map<String,Object> |
getMetrics()
Returns the set of metrics.
|
String |
getName()
Returns the name of the component.
|
void |
setDuration(int duration)
Sets the duration over which the metric data was collected (in seconds).
|
void |
setGuid(String guid)
Sets the guid of the component.
|
void |
setName(String name)
Sets the name of the component.
|
String |
toString()
Returns a string representation of the object.
|
public void setName(String name)
setName
in interface NamedResource
name
- The name of the componentpublic String getName()
getName
in interface NamedResource
public void setGuid(String guid)
guid
- The guid of the componentpublic String getGuid()
public void setDuration(int duration)
duration
- The duration of the metric datapublic int getDuration()
public Map<String,Object> getMetrics()
public void addMetric(String name, int value)
name
- The name of the metricvalue
- The value of the metric timeslicepublic void addMetric(String name, double value)
name
- The name of the metricvalue
- The value of the metric timeslicepublic void addMetric(String name, int[] values)
name
- The name of the metricvalues
- An array of 5 values representing the metric timeslicepublic void addMetric(String name, double[] values)
name
- The name of the metricvalues
- An array of 5 values representing the metric timeslicepublic <T> void addMetric(String name, MetricTimeslice<T> timeslice)
T
- The type parameter used for the timeslicename
- The name of the metrictimeslice
- The values representing the metric timeslicepublic String toString()
public static Component.Builder builder()
Copyright © 2018. All rights reserved.