public interface PcpWriter
Modifier and Type | Method and Description |
---|---|
void |
addMetric(MetricName name,
Semantics semantics,
javax.measure.Unit<?> unit,
Object initialValue)
Adds a new metric to the writer, with an initial default value.
|
<T> void |
addMetric(MetricName name,
Semantics semantics,
javax.measure.Unit<?> unit,
T initialValue,
TypeHandler<T> pcpType)
Adds a new metric to the writer, with an initial default value.
|
<T> void |
registerType(Class<T> runtimeClass,
TypeHandler<T> handler)
Registers a new
TypeHandler to be used to convert all subsequent values of type
runtimeClass |
void |
reset()
Prepares this object such that it can be restarted by invoking the
start() method
again. |
void |
setInstanceDomainHelpText(String instanceDomain,
String shortHelpText,
String longHelpText)
Sets the help text associated with an instance domain.
|
void |
setMetricHelpText(String metricName,
String shortHelpText,
String longHelpText)
Sets the help text associated with a particular metric
|
void |
start()
Starts the Writer, freezing the file format and writing out the metadata and initial values.
|
void |
updateMetric(MetricName name,
Object value)
Updates the metric value of the given metric, once the writer has been started
|
void addMetric(MetricName name, Semantics semantics, javax.measure.Unit<?> unit, Object initialValue)
TypeHandler
based on the runtime type of the initialValue parameter.name
- the name of the metric to export. Must not exceed any byte-length limits specified
by the implementationsemantics
- the PCP semantics of the metricunit
- the unit used to measure the metric.initialValue
- the 'default' value to write into the file at initialisation timeIllegalArgumentException
- if the name is too long, the metric name has already been added, or this is no
type handler registered for the runtime class of the initial valueIllegalStateException
- if this writer has already been started, finalising the file layout<T> void addMetric(MetricName name, Semantics semantics, javax.measure.Unit<?> unit, T initialValue, TypeHandler<T> pcpType)
TypeHandler
based on the runtime type of the initialValue parameter.name
- the name of the metric to export. Must not exceed any byte-length limits specified
by the implementationsemantics
- the PCP semantics of the metricunit
- the unit used to measure the metric.initialValue
- the 'default' value to write into the file at initialisation timepcpType
- the type converter to use to render the initial value (and all subsequent values)
to the PCP streamIllegalArgumentException
- if the name is too long or the metric name has already been addedIllegalStateException
- if this writer has already been started, finalising the file layoutvoid updateMetric(MetricName name, Object value)
name
- the metric to updatevalue
- the new value (must be convertible by the TypeHandler
used when adding the
metric)<T> void registerType(Class<T> runtimeClass, TypeHandler<T> handler)
TypeHandler
to be used to convert all subsequent values of type
runtimeClassruntimeClass
- the class to be converted by the new handlerhandler
- the handler to usevoid start() throws IOException
IOException
- if the file cannot be created or written.void setInstanceDomainHelpText(String instanceDomain, String shortHelpText, String longHelpText)
instanceDomain
- Java pseudo-instance domain identifier (i.e. metric prefix; for
animals.dog[xxx].size this is the 'animals.dog' part)shortHelpText
- the short help text; must not exceed any length limits specified by the
implementationlongHelpText
- the long explanatory text; must not exceed any length limits specified by the
implementationvoid setMetricHelpText(String metricName, String shortHelpText, String longHelpText)
metricName
- String version of the metric name, ignoring any possible instance domains. (e.g. for
animals.dog[xxx].size this is 'animals.dog.size')shortHelpText
- the short help text; must not exceed any length limits specified by the
implementationlongHelpText
- the long explanatory text; must not exceed any length limits specified by the
implementationvoid reset()
start()
method
again.Copyright © 2009-2018 Performance Co-Pilot. All Rights Reserved.