use of org.apache.ignite.cluster.ClusterMetrics in project ignite by apache.
the class ZookeeperClusterNode method metrics.
/**
* {@inheritDoc}
*/
@Override
public ClusterMetrics metrics() {
if (metricsProvider != null) {
ClusterMetrics metrics0 = metricsProvider.metrics();
assert metrics0 != null;
metrics = metrics0;
return metrics0;
}
return metrics;
}
use of org.apache.ignite.cluster.ClusterMetrics in project ignite by apache.
the class ClusterMetricsSnapshotSerializeSelfTest method testSerialization.
/**
*/
@Test
public void testSerialization() {
byte[] data = new byte[ClusterMetricsSnapshot.METRICS_SIZE];
ClusterMetrics metrics1 = createMetrics();
// Test serialization.
int off = ClusterMetricsSnapshot.serialize(data, 0, metrics1);
assert off == ClusterMetricsSnapshot.METRICS_SIZE;
// Test deserialization.
ClusterMetrics metrics2 = ClusterMetricsSnapshot.deserialize(data, 0);
assert metrics2 != null;
assert isMetricsEquals(metrics1, metrics2);
}
Aggregations