Search in sources :

Example 6 with ClusterMetricsSnapshot

use of org.apache.ignite.internal.ClusterMetricsSnapshot in project ignite by apache.

the class GridSpiTestContext method createMetrics.

/**
     * @param waitingJobs Waiting jobs count.
     * @param activeJobs Active jobs count.
     * @return Metrics adapter.
     */
private ClusterMetricsSnapshot createMetrics(int waitingJobs, int activeJobs) {
    ClusterMetricsSnapshot metrics = new ClusterMetricsSnapshot();
    metrics.setCurrentWaitingJobs(waitingJobs);
    metrics.setCurrentActiveJobs(activeJobs);
    return metrics;
}
Also used : ClusterMetricsSnapshot(org.apache.ignite.internal.ClusterMetricsSnapshot)

Example 7 with ClusterMetricsSnapshot

use of org.apache.ignite.internal.ClusterMetricsSnapshot in project ignite by apache.

the class GridJobStealingCollisionSpiAttributesSelfTest method beforeTest.

/** {@inheritDoc} */
@Override
protected void beforeTest() throws Exception {
    super.beforeTest();
    rmtNode = new GridTestNode(UUID.randomUUID());
    addSpiDependency(rmtNode);
    rmtNode.setAttribute(U.spiAttribute(getSpi(), WAIT_JOBS_THRESHOLD_NODE_ATTR), getWaitJobsThreshold());
    ClusterMetricsSnapshot metrics = new ClusterMetricsSnapshot();
    metrics.setCurrentWaitingJobs(2);
    rmtNode.setMetrics(metrics);
    getSpiContext().addNode(rmtNode);
    getSpi().setStealingEnabled(true);
}
Also used : ClusterMetricsSnapshot(org.apache.ignite.internal.ClusterMetricsSnapshot) GridTestNode(org.apache.ignite.testframework.GridTestNode)

Aggregations

ClusterMetricsSnapshot (org.apache.ignite.internal.ClusterMetricsSnapshot)7 GridTestNode (org.apache.ignite.testframework.GridTestNode)4 GridSpiTestContext (org.apache.ignite.testframework.GridSpiTestContext)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 IgniteSystemProperties.getInteger (org.apache.ignite.IgniteSystemProperties.getInteger)1 CacheMetrics (org.apache.ignite.cache.CacheMetrics)1 GridIoManager (org.apache.ignite.internal.managers.communication.GridIoManager)1 GridCacheAdapter (org.apache.ignite.internal.processors.cache.GridCacheAdapter)1 GridJobMetrics (org.apache.ignite.internal.processors.jobmetrics.GridJobMetrics)1 GridBoundedConcurrentLinkedHashMap (org.apache.ignite.internal.util.GridBoundedConcurrentLinkedHashMap)1 DiscoveryMetricsProvider (org.apache.ignite.spi.discovery.DiscoveryMetricsProvider)1