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;
}
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);
}
Aggregations