This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch new_win_metric
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit cf8baabd2ea0fb3e53f6a2128bffc2184807ff66
Author: HTHou <[email protected]>
AuthorDate: Thu Mar 12 16:48:03 2026 +0800

    Fix PowerShell disk metric parsing
---
 .../iotdb/metrics/metricsets/net/WindowsNetMetricManager.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/net/WindowsNetMetricManager.java
 
b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/net/WindowsNetMetricManager.java
index 965d4387af6..f793df162b5 100644
--- 
a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/net/WindowsNetMetricManager.java
+++ 
b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/metricsets/net/WindowsNetMetricManager.java
@@ -114,10 +114,11 @@ public class WindowsNetMetricManager implements 
INetMetricManager {
 
   private void updateInterfaces() {
     try {
+      ifaceSet.clear();
       Process process =
           Runtime.getRuntime()
               .exec(
-                  "cmd.exe /c chcp 65001 > nul & powershell.exe -Command 
\"Get-NetAdapter | Select Name | Format-List \"");
+                  "cmd.exe /c chcp 65001 > nul & powershell.exe -Command 
\"Get-NetAdapter -IncludeHidden | Select Name | Format-List \"");
       BufferedReader reader =
           new BufferedReader(
               new InputStreamReader(process.getInputStream(), 
StandardCharsets.UTF_8));
@@ -140,10 +141,14 @@ public class WindowsNetMetricManager implements 
INetMetricManager {
 
   private void updateStatistics() {
     try {
+      receivedBytesMapForIface.clear();
+      transmittedBytesMapForIface.clear();
+      receivedPacketsMapForIface.clear();
+      transmittedPacketsMapForIface.clear();
       Process process =
           Runtime.getRuntime()
               .exec(
-                  "cmd.exe /c chcp 65001 > nul & powershell.exe -Command 
\"Get-NetAdapterStatistics | Format-List 
Name,ReceivedBytes,SentBytes,ReceivedUnicastPackets,SentUnicastPackets \"");
+                  "cmd.exe /c chcp 65001 > nul & powershell.exe -Command 
\"Get-NetAdapterStatistics -IncludeHidden | Format-List 
Name,ReceivedBytes,SentBytes,ReceivedUnicastPackets,SentUnicastPackets \"");
       BufferedReader reader =
           new BufferedReader(
               new InputStreamReader(process.getInputStream(), 
StandardCharsets.UTF_8));

Reply via email to