use of org.onosproject.cpman.MetricValue in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method testMemoryMetric.
/**
* Tests memory metric update and load function.
*/
@Test
public void testMemoryMetric() {
MetricValue mv = new MetricValue.Builder().load(40).add();
MEMORY_METRICS.forEach(cmt -> testUpdateMetricWithoutId(cmt, mv));
MEMORY_METRICS.forEach(cmt -> testLoadMetric(nodeId, cmt, mv));
}
use of org.onosproject.cpman.MetricValue in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method testControlMessage.
/**
* Tests control message update and load function.
*/
@Test
public void testControlMessage() {
MetricValue mv = new MetricValue.Builder().load(10).add();
Set<DeviceId> set = ImmutableSet.of(DeviceId.deviceId("of:0000000000000001"), DeviceId.deviceId("of:0000000000000002"));
set.forEach(devId -> CONTROL_MESSAGE_METRICS.forEach(cmt -> testUpdateMetricWithId(cmt, mv, devId)));
set.forEach(devId -> CONTROL_MESSAGE_METRICS.forEach(cmt -> testLoadMetricWithId(nodeId, cmt, mv, devId)));
}
use of org.onosproject.cpman.MetricValue in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method testDiskMetric.
/**
* Tests disk metric update and load function.
*/
@Test
public void testDiskMetric() {
MetricValue mv = new MetricValue.Builder().load(50).add();
Set<String> set = ImmutableSet.of("disk1", "disk2");
set.forEach(disk -> DISK_METRICS.forEach(cmt -> testUpdateMetricWithResource(cmt, mv, disk)));
set.forEach(disk -> DISK_METRICS.forEach(cmt -> testLoadMetricWithResource(nodeId, cmt, mv, disk)));
}
use of org.onosproject.cpman.MetricValue in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method testNetworkMetric.
/**
* Tests network metric update and load function.
*/
@Test
public void testNetworkMetric() {
MetricValue mv = new MetricValue.Builder().load(10).add();
Set<String> set = ImmutableSet.of("eth0", "eth1");
set.forEach(network -> NETWORK_METRICS.forEach(cmt -> testUpdateMetricWithResource(cmt, mv, network)));
set.forEach(network -> NETWORK_METRICS.forEach(cmt -> testLoadMetricWithResource(nodeId, cmt, mv, network)));
}
use of org.onosproject.cpman.MetricValue in project onos by opennetworkinglab.
the class ControlPlaneMonitorTest method testCpuMetric.
/**
* Tests cpu metric update and load function.
*/
@Test
public void testCpuMetric() {
MetricValue mv = new MetricValue.Builder().load(30).add();
CPU_METRICS.forEach(cmt -> testUpdateMetricWithoutId(cmt, mv));
CPU_METRICS.forEach(cmt -> testLoadMetric(nodeId, cmt, mv));
}
Aggregations