Package org.onosproject.utils
Class MeteringAgent
- java.lang.Object
-
- org.onosproject.utils.MeteringAgent
-
public class MeteringAgent extends java.lang.Object
Agent that implements usage and performance monitoring via the metrics service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
MeteringAgent.Context
Timer.Context with a specific operation.
-
Constructor Summary
Constructors Constructor Description MeteringAgent(java.lang.String primitiveName, java.lang.String objName, boolean activated)
Constructs a new MeteringAgent for a given distributed primitive.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MeteringAgent.Context
startTimer(java.lang.String op)
Initializes a specific timer for a given operation.
-
-
-
Constructor Detail
-
MeteringAgent
public MeteringAgent(java.lang.String primitiveName, java.lang.String objName, boolean activated)
Constructs a new MeteringAgent for a given distributed primitive. Instantiates the metrics service Initializes all the general metrics for that object- Parameters:
primitiveName
- Type of primitive to be meteredobjName
- Global name of the primitiveactivated
- boolean flag for whether metering is enabled or not
-
-
Method Detail
-
startTimer
public MeteringAgent.Context startTimer(java.lang.String op)
Initializes a specific timer for a given operation.- Parameters:
op
- Specific operation being metered- Returns:
- timer context
-
-