Package org.onosproject.cpman
Interface ControlPlaneMonitorService
-
public interface ControlPlaneMonitorService
Control Plane Statistics Service Interface.
-
-
Field Summary
Fields Modifier and Type Field Description static long
TIMEOUT_MILLIS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>>
availableResources(NodeId nodeId, ControlResource.Type resourceType)
Obtains a list of names of available resources.default java.util.Set<java.lang.String>
availableResourcesSync(NodeId nodeId, ControlResource.Type resourceType)
Synchronous version of availableResource.java.util.concurrent.CompletableFuture<ControlLoadSnapshot>
getLoad(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.lang.String resourceName)
Obtains snapshot of control plane load of a specific resource with the projected range.java.util.concurrent.CompletableFuture<ControlLoadSnapshot>
getLoad(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.util.Optional<DeviceId> deviceId)
Obtains snapshot of control plane load of a specific device with the projected range.java.util.concurrent.CompletableFuture<ControlLoadSnapshot>
getLoad(NodeId nodeId, ControlMetricType type, java.lang.String resourceName)
Obtains snapshot of control plane load of a specific resource.java.util.concurrent.CompletableFuture<ControlLoadSnapshot>
getLoad(NodeId nodeId, ControlMetricType type, java.util.Optional<DeviceId> deviceId)
Obtains snapshot of control plane load of a specific device.default ControlLoadSnapshot
getLoadSync(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.lang.String resourceName)
Synchronous version of getLoad.default ControlLoadSnapshot
getLoadSync(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.util.Optional<DeviceId> deviceId)
Synchronous version of getLoad.default ControlLoadSnapshot
getLoadSync(NodeId nodeId, ControlMetricType type, java.lang.String resourceName)
Synchronous version of getLoad.default ControlLoadSnapshot
getLoadSync(NodeId nodeId, ControlMetricType type, java.util.Optional<DeviceId> deviceId)
Synchronous version of getLoad.void
updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes, java.lang.String resourceName)
Adds a new control metric value with a certain update interval.void
updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes, java.util.Optional<DeviceId> deviceId)
Adds a new control metric value with a certain update interval.
-
-
-
Field Detail
-
TIMEOUT_MILLIS
static final long TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
updateMetric
void updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes, java.util.Optional<DeviceId> deviceId)
Adds a new control metric value with a certain update interval.- Parameters:
controlMetric
- control plane metric (e.g., control message rate, cpu, memory, etc.)updateIntervalInMinutes
- value update interval (in minute)deviceId
- device identifier
-
updateMetric
void updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes, java.lang.String resourceName)
Adds a new control metric value with a certain update interval.- Parameters:
controlMetric
- control plane metric (e.g., disk and network metrics)updateIntervalInMinutes
- value update interval (in minute)resourceName
- resource name
-
getLoad
java.util.concurrent.CompletableFuture<ControlLoadSnapshot> getLoad(NodeId nodeId, ControlMetricType type, java.util.Optional<DeviceId> deviceId)
Obtains snapshot of control plane load of a specific device. The metrics range from control messages and system metrics (e.g., CPU and memory info). If the device id is not specified, it returns system metrics, otherwise, it returns control message stats of the given device.- Parameters:
nodeId
- node identifiertype
- control metric typedeviceId
- device identifier- Returns:
- completable future object of control load snapshot
-
getLoadSync
default ControlLoadSnapshot getLoadSync(NodeId nodeId, ControlMetricType type, java.util.Optional<DeviceId> deviceId)
Synchronous version of getLoad. Obtains snapshot of control plane load of a specific device. The metrics range from control messages and system metrics (e.g., CPU and memory info). If the device id is not specified, it returns system metrics, otherwise, it returns control message stats of the given device.- Parameters:
nodeId
- node identifiertype
- control metric typedeviceId
- device identifier- Returns:
- control load snapshot
-
getLoad
java.util.concurrent.CompletableFuture<ControlLoadSnapshot> getLoad(NodeId nodeId, ControlMetricType type, java.lang.String resourceName)
Obtains snapshot of control plane load of a specific resource. The metrics include I/O device metrics (e.g., disk and network metrics).- Parameters:
nodeId
- node identifiertype
- control metric typeresourceName
- resource name- Returns:
- completable future object of control load snapshot
-
getLoadSync
default ControlLoadSnapshot getLoadSync(NodeId nodeId, ControlMetricType type, java.lang.String resourceName)
Synchronous version of getLoad. Obtains snapshot of control plane load of a specific resource. The metrics include I/O device metrics (e.g., disk and network metrics).- Parameters:
nodeId
- node identifiertype
- control metric typeresourceName
- resource name- Returns:
- control load snapshot
-
getLoad
java.util.concurrent.CompletableFuture<ControlLoadSnapshot> getLoad(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.util.Optional<DeviceId> deviceId)
Obtains snapshot of control plane load of a specific device with the projected range.- Parameters:
nodeId
- node identifiertype
- control metric typeduration
- projected durationunit
- projected time unitdeviceId
- device identifier- Returns:
- completable future object of control load snapshot
-
getLoadSync
default ControlLoadSnapshot getLoadSync(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.util.Optional<DeviceId> deviceId)
Synchronous version of getLoad. Obtains snapshot of control plane load of a specific device with the projected range.- Parameters:
nodeId
- node identifiertype
- control metric typeduration
- projected durationunit
- projected time unitdeviceId
- device identifier- Returns:
- control load snapshot
-
getLoad
java.util.concurrent.CompletableFuture<ControlLoadSnapshot> getLoad(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.lang.String resourceName)
Obtains snapshot of control plane load of a specific resource with the projected range.- Parameters:
nodeId
- node identifiertype
- control metric typeduration
- projected durationunit
- projected time unitresourceName
- resource name- Returns:
- completable future object of control load snapshot
-
getLoadSync
default ControlLoadSnapshot getLoadSync(NodeId nodeId, ControlMetricType type, int duration, java.util.concurrent.TimeUnit unit, java.lang.String resourceName)
Synchronous version of getLoad. Obtains snapshot of control plane load of a specific resource with the projected range.- Parameters:
nodeId
- node identifiertype
- control metric typeduration
- projected durationunit
- projected time unitresourceName
- resource name- Returns:
- control load snapshot
-
availableResources
java.util.concurrent.CompletableFuture<java.util.Set<java.lang.String>> availableResources(NodeId nodeId, ControlResource.Type resourceType)
Obtains a list of names of available resources.- Parameters:
nodeId
- node identifierresourceType
- resource type- Returns:
- completable future object of a collection of available resource names
-
availableResourcesSync
default java.util.Set<java.lang.String> availableResourcesSync(NodeId nodeId, ControlResource.Type resourceType)
Synchronous version of availableResource. Obtains a list of names of available resources.- Parameters:
nodeId
- node identifierresourceType
- resource type- Returns:
- a collection of available resource names
-
-