|
1 | 1 | /* |
2 | | - * Copyright (c) 2000, 2023, Oracle and/or its affiliates. |
| 2 | + * Copyright (c) 2000, 2026, Oracle and/or its affiliates. |
3 | 3 | * |
4 | 4 | * Licensed under the Universal Permissive License v 1.0 as shown at |
5 | 5 | * https://oss.oracle.com/licenses/upl. |
@@ -693,17 +693,25 @@ public void shouldGetPlatformMemoryMetrics() |
693 | 693 |
|
694 | 694 | Map<String, String> mapTags = getCommonTagsWithNodeId(); |
695 | 695 |
|
| 696 | + List<String> listExpectedMetrics = |
| 697 | + new ArrayList<>(Arrays.asList("Coherence.Memory.ObjectPendingFinalizationCount", |
| 698 | + "Coherence.Memory.HeapMemoryUsage.committed", |
| 699 | + "Coherence.Memory.HeapMemoryUsage.init", |
| 700 | + "Coherence.Memory.HeapMemoryUsage.max", |
| 701 | + "Coherence.Memory.HeapMemoryUsage.used", |
| 702 | + "Coherence.Memory.NonHeapMemoryUsage.committed", |
| 703 | + "Coherence.Memory.NonHeapMemoryUsage.init", |
| 704 | + "Coherence.Memory.NonHeapMemoryUsage.max", |
| 705 | + "Coherence.Memory.NonHeapMemoryUsage.used")); |
| 706 | + |
| 707 | + if (s_bTestJdk26) |
| 708 | + { |
| 709 | + listExpectedMetrics.add("Coherence.Memory.TotalGcCpuTime"); |
| 710 | + } |
| 711 | + |
696 | 712 | assertMetricsWithoutAfterGC(adapter.getMetrics(), |
697 | 713 | mapTags, |
698 | | - "Coherence.Memory.ObjectPendingFinalizationCount", |
699 | | - "Coherence.Memory.HeapMemoryUsage.committed", |
700 | | - "Coherence.Memory.HeapMemoryUsage.init", |
701 | | - "Coherence.Memory.HeapMemoryUsage.max", |
702 | | - "Coherence.Memory.HeapMemoryUsage.used", |
703 | | - "Coherence.Memory.NonHeapMemoryUsage.committed", |
704 | | - "Coherence.Memory.NonHeapMemoryUsage.init", |
705 | | - "Coherence.Memory.NonHeapMemoryUsage.max", |
706 | | - "Coherence.Memory.NonHeapMemoryUsage.used"); |
| 714 | + listExpectedMetrics.toArray(new String[0])); |
707 | 715 | } |
708 | 716 |
|
709 | 717 | @Test |
@@ -1039,6 +1047,11 @@ public void remove(MBeanMetric.Identifier identifier) |
1039 | 1047 | */ |
1040 | 1048 | private static final Boolean s_bTestJdk15 = Integer.parseInt(System.getProperty("java.version").split("-|\\.")[0]) > 14; |
1041 | 1049 |
|
| 1050 | + /** |
| 1051 | + * True iff JVM is for JDK 26 or greater. |
| 1052 | + */ |
| 1053 | + private static final Boolean s_bTestJdk26 = Integer.parseInt(System.getProperty("java.version").split("-|\\.")[0]) > 25; |
| 1054 | + |
1042 | 1055 | // ----- data members --------------------------------------------------- |
1043 | 1056 |
|
1044 | 1057 | private static Registry s_registry; |
|
0 commit comments