From 63b27f55c6a3461482066a13f08332b7c6f9a4c9 Mon Sep 17 00:00:00 2001 From: fanfuxiaoran <495538672@qq.com> Date: Mon, 12 Aug 2013 14:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20native=E6=96=87=E4=BB=B6=E5=AE=B6?= =?UTF-8?q?=E9=87=8C=E6=B7=BB=E5=8A=A0=E4=BA=86=20System.h=20=E5=92=8Csyst?= =?UTF-8?q?em.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WindowsMonitor/Monitor/System.cpp | 3 ++- WindowsMonitor/Native/SystemMonitor.h | 6 +++--- src/main/java/org/bench4q/monitor/model/SystemModel.java | 3 +++ .../monitor/service/windows/SystemServiceWindows.java | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/WindowsMonitor/Monitor/System.cpp b/WindowsMonitor/Monitor/System.cpp index 930a9a32..7fee5d8d 100644 --- a/WindowsMonitor/Monitor/System.cpp +++ b/WindowsMonitor/Monitor/System.cpp @@ -96,7 +96,8 @@ double System::GetSystemUpTime() fullCounterPath+=L"\\System\\System Up Time"; double ret=Common::GetCounterValue(fullCounterPath.c_str()); return ret; -} + } + // Processor Queue Length double System::GetProcessorQueueLength() diff --git a/WindowsMonitor/Native/SystemMonitor.h b/WindowsMonitor/Native/SystemMonitor.h index 74d84081..528b59bc 100644 --- a/WindowsMonitor/Native/SystemMonitor.h +++ b/WindowsMonitor/Native/SystemMonitor.h @@ -1,5 +1,5 @@ #include -/* Header for class org_bench4q_monitor_performance_windows_TCPv4Monitor */ +/* Header for class org_bench4q_monitor_performance_windows_SystemMonitor */ #ifndef _Included_org_bench4q_monitor_performance_windows_SystemMonitor #define _Included_org_bench4q_monitor_performance_windows_SystemMonitor @@ -10,12 +10,12 @@ extern "C" { (JNIEnv * environment, jobject object); -JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_SystemMonitor_GetFileDataOperationsPerSecond +JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_SystemMonitor_getFileDataOperationsPerSecond (JNIEnv * environment, jobject object, jint idleTime); -JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_SystemMonitor_GetProcessorQueueLength +JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_SystemMonitor_getProcessorQueueLength (JNIEnv * environment, jobject object); #ifdef __cplusplus diff --git a/src/main/java/org/bench4q/monitor/model/SystemModel.java b/src/main/java/org/bench4q/monitor/model/SystemModel.java index 6eafc971..06b15c2f 100644 --- a/src/main/java/org/bench4q/monitor/model/SystemModel.java +++ b/src/main/java/org/bench4q/monitor/model/SystemModel.java @@ -1,5 +1,8 @@ package org.bench4q.monitor.model; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement public class SystemModel { private double fileDataOperationsPerSecond; diff --git a/src/main/java/org/bench4q/monitor/service/windows/SystemServiceWindows.java b/src/main/java/org/bench4q/monitor/service/windows/SystemServiceWindows.java index d581569d..3cf4c865 100644 --- a/src/main/java/org/bench4q/monitor/service/windows/SystemServiceWindows.java +++ b/src/main/java/org/bench4q/monitor/service/windows/SystemServiceWindows.java @@ -27,8 +27,9 @@ public class SystemServiceWindows { public SystemModel getSystemInfo(int idleTime){ SystemModel systemModel=new SystemModel(); + systemModel.setFileDataOperationsPerSecond(this.getSystemMonitor().getFileDataOperationsPerSecond(idleTime)); - systemModel.setProcessorQueueLength(this.getSystemMonitor().getProcessorQueueLength()); + systemModel.setProcessorQueueLength(this.getSystemMonitor().getProcessorQueueLength()); double totalProceesorTimePercent=this.getProcessorMonitor().getProcessorTimePercent("_Total", idleTime); systemModel.setTotalProceesorTimePercent(totalProceesorTimePercent); return systemModel;