@Service public class DefaultInfluxDbMetricsReporter extends Object implements InfluxDbMetricsReporter
| Modifier and Type | Field and Description |
|---|---|
protected String |
address |
protected org.onosproject.cfg.ComponentConfigService |
cfgService |
protected org.onosproject.cluster.ClusterService |
clusterService |
protected org.onosproject.core.CoreService |
coreService |
protected String |
database |
protected String |
metricNames |
protected org.onlab.metrics.MetricsService |
metricsService |
protected boolean |
monitorAll |
protected String |
password |
protected int |
port |
protected String |
username |
| Constructor and Description |
|---|
DefaultInfluxDbMetricsReporter() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
protected com.codahale.metrics.MetricRegistry |
addHostPrefix(com.codahale.metrics.MetricRegistry metricRegistry)
Appends node IP prefix to all performance metrics.
|
void |
config(String address,
int port,
String database,
String username,
String password)
Configures default parameters for influx database metrics reporter.
|
protected boolean |
containsName(String full,
String prefixes)
Looks up whether the metric name contains the given prefix keywords.
|
void |
deactivate() |
protected com.codahale.metrics.MetricRegistry |
filter(com.codahale.metrics.MetricRegistry metricRegistry)
Filters the metrics to only include a set of the given metrics.
|
void |
modified(org.osgi.service.component.ComponentContext context) |
void |
notifyMetricsChange() |
void |
restartReport() |
void |
startReport() |
void |
stopReport() |
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.core.CoreService coreService
@Reference(cardinality=MANDATORY_UNARY) protected org.onlab.metrics.MetricsService metricsService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cfg.ComponentConfigService cfgService
@Reference(cardinality=MANDATORY_UNARY) protected org.onosproject.cluster.ClusterService clusterService
@Property(name="monitorAll",
boolValue=true,
label="Enable to monitor all of metrics stored in metric registry default is true")
protected boolean monitorAll
@Property(name="metricNames",
value="default",
label="Names of metric to be monitored in third party monitoring server; default metric names are \'default\'")
protected String metricNames
protected String address
protected int port
protected String database
protected String username
protected String password
@Activate public void activate()
@Deactivate public void deactivate()
@Modified public void modified(org.osgi.service.component.ComponentContext context)
public void startReport()
startReport in interface org.onlab.metrics.MetricsReporterpublic void stopReport()
stopReport in interface org.onlab.metrics.MetricsReporterpublic void restartReport()
restartReport in interface org.onlab.metrics.MetricsReporterpublic void notifyMetricsChange()
notifyMetricsChange in interface org.onlab.metrics.MetricsReporterpublic void config(String address, int port, String database, String username, String password)
InfluxDbMetricsReporterconfig in interface InfluxDbMetricsReporteraddress - IP address of influxDB serverport - Port number of influxDB serverdatabase - Database name of influxDB serverusername - Username of influxDB serverpassword - Password of influxDB serverprotected com.codahale.metrics.MetricRegistry filter(com.codahale.metrics.MetricRegistry metricRegistry)
metricRegistry - original metric registryprotected com.codahale.metrics.MetricRegistry addHostPrefix(com.codahale.metrics.MetricRegistry metricRegistry)
metricRegistry - original metric registryprotected boolean containsName(String full, String prefixes)
full - the original metric name that to be compared withprefixes - the prefix keywords that are matched against with the metric nameCopyright © 2016. All rights reserved.