File tree Expand file tree Collapse file tree
main/java/org/apache/flink/runtime/metrics/util
test/java/org/apache/flink/runtime/metrics/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838import org .apache .flink .runtime .rpc .RpcSystem ;
3939import org .apache .flink .runtime .taskexecutor .slot .SlotNotFoundException ;
4040import org .apache .flink .runtime .taskexecutor .slot .TaskSlotTable ;
41+ import org .apache .flink .util .OperatingSystem ;
4142import org .apache .flink .util .Preconditions ;
4243
4344import org .slf4j .Logger ;
@@ -88,6 +89,8 @@ public class MetricUtils {
8889 private static final String WRITER_SUFFIX = ": " + ConfigConstants .WRITER_NAME ;
8990 private static final String COMMITTER_SUFFIX = ": " + ConfigConstants .COMMITTER_NAME ;
9091
92+ private static Boolean fileDescriptorWarningShown = false ;
93+
9194 private MetricUtils () {}
9295
9396 public static ProcessMetricGroup instantiateProcessMetricGroup (
@@ -340,6 +343,13 @@ static void instantiateMetaspaceMemoryMetrics(final MetricGroup parentMetricGrou
340343 }
341344
342345 static void instantiateFileDescriptorMetrics (MetricGroup metrics ) {
346+ if (OperatingSystem .isWindows ()) {
347+ if (!fileDescriptorWarningShown ) {
348+ fileDescriptorWarningShown = true ;
349+ LOG .info ("Running on Windows, FileDescriptor metrics will not be available." );
350+ }
351+ return ;
352+ }
343353 try {
344354 final com .sun .management .OperatingSystemMXBean mxBean =
345355 (com .sun .management .OperatingSystemMXBean )
Original file line number Diff line number Diff line change 4242
4343import org .junit .jupiter .api .AfterEach ;
4444import org .junit .jupiter .api .Test ;
45+ import org .junit .jupiter .api .condition .DisabledOnOs ;
46+ import org .junit .jupiter .api .condition .OS ;
4547
4648import javax .management .ObjectName ;
4749
@@ -178,6 +180,7 @@ void testHeapMetricsCompleteness() {
178180 }
179181
180182 @ Test
183+ @ DisabledOnOs (OS .WINDOWS )
181184 void testFileDescriptorMetricsCompleteness () {
182185 final InterceptingOperatorMetricGroup heapMetrics = new InterceptingOperatorMetricGroup ();
183186
You can’t perform that action at this time.
0 commit comments