7
7
import org .junit .jupiter .api .*;
8
8
import io .deephaven .benchmark .api .Bench ;
9
9
10
+ /**
11
+ * Test to see what metrics are available in the remote Deephaven Server. Note. These tests should pass when DH is
12
+ * either JVM 17 or JVM 21
13
+ */
10
14
public class MetricsCollectionTest {
11
15
final Bench api = Bench .create (this );
12
16
@@ -23,7 +27,8 @@ public void collect1MetricSet() {
23
27
api .query (query ).fetchAfter ("mymetrics" , table -> {
24
28
assertEquals ("timestamp, origin, category, type, name, value, note" , formatCols (table .getColumnNames ()),
25
29
"Wrong column names" );
26
- assertEquals (21 , table .getRowCount (), "Wrong row count" );
30
+ int rowCount = table .getRowCount ();
31
+ assertTrue (rowCount == 21 || rowCount == 23 , "Wrong row count. Got " + rowCount );
27
32
assertEquals ("ClassLoadingImpl" , table .getValue (0 , "category" ), "Wrong bean name" );
28
33
assertEquals ("TotalLoadedClassCount" , table .getValue (0 , "name" ), "Wrong " );
29
34
assertTrue (table .getValue (3 , "value" ).toString ()
@@ -45,7 +50,8 @@ public void collect2MetricSets() {
45
50
api .query (query ).fetchAfter ("mymetrics" , table -> {
46
51
assertEquals ("timestamp, origin, category, type, name, value, note" , formatCols (table .getColumnNames ()),
47
52
"Wrong column names" );
48
- assertEquals (42 , table .getRowCount (), "Wrong row count" );
53
+ int rowCount = table .getRowCount ();
54
+ assertTrue (rowCount == 42 || rowCount == 46 , "Wrong row count. Got " + rowCount );
49
55
}).execute ();
50
56
}
51
57
@@ -60,7 +66,8 @@ public void collectMetricsToFile() throws Exception {
60
66
""" ;
61
67
62
68
api .query (query ).fetchAfter ("mymetrics" , table -> {
63
- assertEquals (21 , table .getRowCount (), "Wrong row count" );
69
+ int rowCount = table .getRowCount ();
70
+ assertTrue (rowCount == 21 || rowCount == 23 , "Wrong row count. Got " + rowCount );
64
71
api .metrics ().add (table );
65
72
}).execute ();
66
73
api .close ();
0 commit comments