在 native文件家里添加了 System.h 和system.cpp
This commit is contained in:
parent
0653718a7e
commit
63b27f55c6
|
@ -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()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <jni.h>
|
||||
/* 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
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package org.bench4q.monitor.model;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement
|
||||
public class SystemModel {
|
||||
|
||||
private double fileDataOperationsPerSecond;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue