From 0bd73b53428548915693b4063ba5d358714c0fb4 Mon Sep 17 00:00:00 2001 From: "yunyao.zxl" Date: Sun, 2 Aug 2020 14:05:32 +0800 Subject: [PATCH] [Wisp] Fix Windows compatibility issue by adding dummy getX methods Summary: as the title Test Plan: On Windows platform: TestAggressiveHeap.java, TestExcessGCLockerCollections.java and ThreadCpuTimesDeadlock.java Reviewed-by: yuleil, shiyuexw Issue: https://github.com/alibaba/dragonwell8/issues/113 --- .../com/alibaba/wisp/engine/WispCounter.java | 59 +++++++++++++++++++ .../wisp/engine/WispCounterMXBeanImpl.java | 5 +- .../com/alibaba/wisp/engine/WispCounter.java | 59 +++++++++++++++++++ .../wisp/engine/WispCounterMXBeanImpl.java | 5 +- 4 files changed, 126 insertions(+), 2 deletions(-) diff --git a/src/macosx/classes/com/alibaba/wisp/engine/WispCounter.java b/src/macosx/classes/com/alibaba/wisp/engine/WispCounter.java index 0975f6737..10fde1f02 100644 --- a/src/macosx/classes/com/alibaba/wisp/engine/WispCounter.java +++ b/src/macosx/classes/com/alibaba/wisp/engine/WispCounter.java @@ -23,4 +23,63 @@ package com.alibaba.wisp.engine; final public class WispCounter { + public long getCompletedTaskCount() { + return 0; + } + + public long getTotalEnqueueTime() { + return 0; + } + + public long getEnqueueCount() { + return 0; + } + + public long getTotalExecutionTime() { + return 0; + } + + public long getExecutionCount() { + return 0; + } + + public long getTotalWaitSocketIOTime() { + return 0; + } + + public long getWaitSocketIOCount() { + return 0; + } + + public long getTotalBlockingTime() { + return 0; + } + + public long getUnparkCount() { + return 0; + } + + public long getMaxEnqueueTime() { + return 0; + } + + public long getMaxExecutionTime() { + return 0; + } + + public long getMaxWaitSocketIOTime() { + return 0; + } + + public long getMaxBlockingTime() { + return 0; + } + + public long getTaskQueueLength() { + return 0; + } + + public long getRunningTaskCount() { + return 0; + } } diff --git a/src/macosx/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java b/src/macosx/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java index 6438cc340..0939a1409 100644 --- a/src/macosx/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java +++ b/src/macosx/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java @@ -22,12 +22,15 @@ package com.alibaba.wisp.engine; import com.alibaba.management.WispCounterMXBean; +import sun.management.Util; import javax.management.ObjectName; import java.util.List; public class WispCounterMXBeanImpl implements WispCounterMXBean { + private final static String WISP_COUNTER_MXBEAN_NAME = "com.alibaba.management:type=WispCounter"; + @Override public List getRunningStates() { throw new UnsupportedOperationException(); @@ -145,6 +148,6 @@ public class WispCounterMXBeanImpl implements WispCounterMXBean { @Override public ObjectName getObjectName() { - throw new UnsupportedOperationException(); + return Util.newObjectName(WISP_COUNTER_MXBEAN_NAME); } } diff --git a/src/windows/classes/com/alibaba/wisp/engine/WispCounter.java b/src/windows/classes/com/alibaba/wisp/engine/WispCounter.java index 0975f6737..10fde1f02 100644 --- a/src/windows/classes/com/alibaba/wisp/engine/WispCounter.java +++ b/src/windows/classes/com/alibaba/wisp/engine/WispCounter.java @@ -23,4 +23,63 @@ package com.alibaba.wisp.engine; final public class WispCounter { + public long getCompletedTaskCount() { + return 0; + } + + public long getTotalEnqueueTime() { + return 0; + } + + public long getEnqueueCount() { + return 0; + } + + public long getTotalExecutionTime() { + return 0; + } + + public long getExecutionCount() { + return 0; + } + + public long getTotalWaitSocketIOTime() { + return 0; + } + + public long getWaitSocketIOCount() { + return 0; + } + + public long getTotalBlockingTime() { + return 0; + } + + public long getUnparkCount() { + return 0; + } + + public long getMaxEnqueueTime() { + return 0; + } + + public long getMaxExecutionTime() { + return 0; + } + + public long getMaxWaitSocketIOTime() { + return 0; + } + + public long getMaxBlockingTime() { + return 0; + } + + public long getTaskQueueLength() { + return 0; + } + + public long getRunningTaskCount() { + return 0; + } } diff --git a/src/windows/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java b/src/windows/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java index 6438cc340..0939a1409 100644 --- a/src/windows/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java +++ b/src/windows/classes/com/alibaba/wisp/engine/WispCounterMXBeanImpl.java @@ -22,12 +22,15 @@ package com.alibaba.wisp.engine; import com.alibaba.management.WispCounterMXBean; +import sun.management.Util; import javax.management.ObjectName; import java.util.List; public class WispCounterMXBeanImpl implements WispCounterMXBean { + private final static String WISP_COUNTER_MXBEAN_NAME = "com.alibaba.management:type=WispCounter"; + @Override public List getRunningStates() { throw new UnsupportedOperationException(); @@ -145,6 +148,6 @@ public class WispCounterMXBeanImpl implements WispCounterMXBean { @Override public ObjectName getObjectName() { - throw new UnsupportedOperationException(); + return Util.newObjectName(WISP_COUNTER_MXBEAN_NAME); } } -- GitLab