shishkovilja commented on code in PR #13661:
URL: https://github.com/apache/ignite/pull/13661#discussion_r4357591771
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/odbc/ClientListenerMetricsTest.java:
##########
@@ -160,6 +204,285 @@ public void testClientListenerMetricsRejectGeneral()
throws Exception {
}
}
+ /**
+ * Check that the active compute tasks metric reports the peak of the
busiest connection (not the sum), keeps it
+ * during the time interval and drops it after the time interval.
+ */
+ @Test
+ public void testComputeTasksMetrics() throws Exception {
+ startGridWithCompute();
+
+ List<IgniteInternalFuture<Object>> futs = new ArrayList<>();
+
+ try (
+ IgniteClient client1 =
Ignition.startClient(getClientConfiguration());
+ IgniteClient client2 =
Ignition.startClient(getClientConfiguration())
+ ) {
+ checkPeakComputeTasks(0);
+ assertEquals(0, activeComputeTasksCount());
+
+ // Tasks 0, 1.
+ futs.addAll(startTasks(client1, 2));
+ checkPeakComputeTasks(2);
+ assertEquals(2, activeComputeTasksCount());
+
+ // Run tasks 2, 3. Metric should not change.
+ futs.addAll(startTasks(client2, 2));
+ checkPeakComputeTasks(2);
+ assertEquals(4, activeComputeTasksCount());
+
+ // Task 4. Metric should increase.
+ futs.addAll(startTasks(client2, 1));
+ checkPeakComputeTasks(MAX_TASKS);
Review Comment:
But MAX_TASKS == 3? What is wrong here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]