Search in sources :

Example 21 with ClusterMetrics

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;
}
Also used : ClusterMetrics(org.apache.ignite.cluster.ClusterMetrics)

Example 22 with ClusterMetrics

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);
}
Also used : ClusterMetrics(org.apache.ignite.cluster.ClusterMetrics) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test) GridCommonTest(org.apache.ignite.testframework.junits.common.GridCommonTest)

Aggregations

ClusterMetrics (org.apache.ignite.cluster.ClusterMetrics)22 Ignite (org.apache.ignite.Ignite)8 Test (org.junit.Test)8 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)7 GridCommonTest (org.apache.ignite.testframework.junits.common.GridCommonTest)6 Map (java.util.Map)5 HashMap (java.util.HashMap)4 UUID (java.util.UUID)4 ClusterNode (org.apache.ignite.cluster.ClusterNode)3 CountDownLatch (java.util.concurrent.CountDownLatch)2 GridTestTask (org.apache.ignite.GridTestTask)2 IgniteClientDisconnectedException (org.apache.ignite.IgniteClientDisconnectedException)2 IgniteException (org.apache.ignite.IgniteException)2 RuntimeMXBean (java.lang.management.RuntimeMXBean)1 InetAddress (java.net.InetAddress)1 DecimalFormat (java.text.DecimalFormat)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 Collection (java.util.Collection)1 List (java.util.List)1