mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-18 10:51:04 +02:00
Minor cleanup in the Metrics module:
* Add missing Javadoc * Line formatting No functional changes.
This commit is contained in:
parent
c1c056b471
commit
df042bd11d
@ -24,14 +24,17 @@ public class MetricsComponent implements MetricsComponentRegistry {
|
|||||||
name = newName;
|
name = newName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String getName() {
|
@Override
|
||||||
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public MetricsFeature registerFeature(final String featureName) {
|
@Override
|
||||||
|
public MetricsFeature registerFeature(final String featureName) {
|
||||||
MetricsFeature feature = featuresRegistry.get(featureName);
|
MetricsFeature feature = featuresRegistry.get(featureName);
|
||||||
if (feature == null) {
|
if (feature == null) {
|
||||||
final MetricsFeature createdFeature = new MetricsFeature(featureName);
|
final MetricsFeature createdFeature =
|
||||||
|
new MetricsFeature(featureName);
|
||||||
feature = featuresRegistry.putIfAbsent(featureName, createdFeature);
|
feature = featuresRegistry.putIfAbsent(featureName, createdFeature);
|
||||||
if (feature == null) {
|
if (feature == null) {
|
||||||
feature = createdFeature;
|
feature = createdFeature;
|
||||||
|
@ -4,7 +4,18 @@ package org.onlab.metrics;
|
|||||||
* Registry Entry for Metrics Components.
|
* Registry Entry for Metrics Components.
|
||||||
*/
|
*/
|
||||||
public interface MetricsComponentRegistry {
|
public interface MetricsComponentRegistry {
|
||||||
|
/**
|
||||||
|
* Fetches the name of the Component.
|
||||||
|
*
|
||||||
|
* @return name of the Component
|
||||||
|
*/
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a Feature for this component.
|
||||||
|
*
|
||||||
|
* @param featureName name of the Feature to register
|
||||||
|
* @return Feature object that can be used when creating Metrics
|
||||||
|
*/
|
||||||
MetricsFeature registerFeature(String featureName);
|
MetricsFeature registerFeature(String featureName);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,11 @@ public class MetricsFeature {
|
|||||||
name = newName;
|
name = newName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches the name of the Feature.
|
||||||
|
*
|
||||||
|
* @return name of the Feature
|
||||||
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user