jni adapter for tcpv6 and physicaldisk added.
This commit is contained in:
parent
01e9cec754
commit
08bbb3fac5
|
@ -152,8 +152,10 @@
|
|||
<ClInclude Include="MonitorApi.h" />
|
||||
<ClInclude Include="Native.h" />
|
||||
<ClInclude Include="NetworkInterfaceMonitor.h" />
|
||||
<ClInclude Include="PhysicalDiskMonitor.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="TCPv4Monitor.h" />
|
||||
<ClInclude Include="TCPv6Monitor.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Common.cpp" />
|
||||
|
@ -174,6 +176,7 @@
|
|||
<ClCompile Include="LogicalDiskMonitor.cpp" />
|
||||
<ClCompile Include="MemoryMonitor.cpp" />
|
||||
<ClCompile Include="NetworkInterfaceMonitor.cpp" />
|
||||
<ClCompile Include="PhysicalDiskMonitor.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
|
@ -181,6 +184,7 @@
|
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TCPv4Monitor.cpp" />
|
||||
<ClCompile Include="TCPv6Monitor.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -39,6 +39,12 @@
|
|||
<ClInclude Include="TCPv4Monitor.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TCPv6Monitor.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PhysicalDiskMonitor.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
@ -62,5 +68,11 @@
|
|||
<ClCompile Include="TCPv4Monitor.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TCPv6Monitor.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PhysicalDiskMonitor.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,206 @@
|
|||
#include "stdafx.h"
|
||||
#include "PhysicalDiskMonitor.h"
|
||||
#include "Common.h"
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getInstances
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
list<wstring> instances=PhysicalDisk::GetInstances();
|
||||
list<wstring>::iterator iter;
|
||||
long count=(long)instances.size();
|
||||
jobjectArray array=environment->NewObjectArray(
|
||||
count,environment->FindClass("java/lang/String"),environment->NewStringUTF(""));
|
||||
int i=0;
|
||||
for(iter=instances.begin();iter!=instances.end();iter++)
|
||||
{
|
||||
environment->SetObjectArrayElement(array,i
|
||||
,environment->NewStringUTF(GetUTF8String((*iter).c_str())));
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getCounterList
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
list<wstring> counterList=PhysicalDisk::GetCounterList();
|
||||
list<wstring>::iterator iter;
|
||||
long count=(long)counterList.size();
|
||||
jobjectArray array=environment->NewObjectArray(
|
||||
count,environment->FindClass("java/lang/String"),environment->NewStringUTF(""));
|
||||
int i=0;
|
||||
for(iter=counterList.begin();iter!=counterList.end();iter++)
|
||||
{
|
||||
environment->SetObjectArrayElement(array,i
|
||||
,environment->NewStringUTF(GetUTF8String((*iter).c_str())));
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getCurrentDiskQueueLength
|
||||
(JNIEnv * environment, jobject object, jstring instanceName)
|
||||
{
|
||||
return PhysicalDisk::GetCurrentDiskQueueLength(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str());
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskTimePercent
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskTimePercent(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskQueueLength
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskQueueLength(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadTimePercent
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskReadTimePercent(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskReadQueueLength
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskReadQueueLength(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWriteTimePercent
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskWriteTimePercent(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskWriteQueueLength
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskWriteQueueLength(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskTransferTimeInSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskTransferTimeInSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskReadTimeInSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskReadTimeInSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskWriteTimeInSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskWriteTimeInSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskTransfersPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskTransfersPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadsPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskReadsPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWritesPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskWritesPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskBytesPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskBytesPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadBytesPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskReadBytesPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWriteBytesPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetDiskWriteBytesPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerTransfer
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskBytesPerTransfer(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerRead
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskBytesPerRead(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerWrite
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetAverageDiskBytesPerWrite(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getIdleTimePercent
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetIdleTimePercent(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getSplitIOPerSecond
|
||||
(JNIEnv * environment, jobject object, jstring instanceName, jint idleTime)
|
||||
{
|
||||
return PhysicalDisk::GetSplitIOPerSecond(
|
||||
Common::StringToWideString(GetJString(environment,instanceName)).c_str()
|
||||
,idleTime);
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_bench4q_monitor_performance_windows_PhysicalDiskMonitor */
|
||||
|
||||
#ifndef _Included_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
#define _Included_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getInstances
|
||||
* Signature: ()[Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getInstances
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getCounterList
|
||||
* Signature: ()[Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getCounterList
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getCurrentDiskQueueLength
|
||||
* Signature: (Ljava/lang/String;)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getCurrentDiskQueueLength
|
||||
(JNIEnv *, jobject, jstring);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskTimePercent
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskTimePercent
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskQueueLength
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskQueueLength
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskReadTimePercent
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadTimePercent
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskReadQueueLength
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskReadQueueLength
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskWriteTimePercent
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWriteTimePercent
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskWriteQueueLength
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskWriteQueueLength
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskTransferTimeInSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskTransferTimeInSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskReadTimeInSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskReadTimeInSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskWriteTimeInSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskWriteTimeInSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskTransfersPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskTransfersPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskReadsPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadsPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskWritesPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWritesPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskBytesPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskBytesPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskReadBytesPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskReadBytesPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getDiskWriteBytesPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getDiskWriteBytesPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskBytesPerTransfer
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerTransfer
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskBytesPerRead
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerRead
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getAverageDiskBytesPerWrite
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getAverageDiskBytesPerWrite
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getIdleTimePercent
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getIdleTimePercent
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_PhysicalDiskMonitor
|
||||
* Method: getSplitIOPerSecond
|
||||
* Signature: (Ljava/lang/String;I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_PhysicalDiskMonitor_getSplitIOPerSecond
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,74 @@
|
|||
#include "stdafx.h"
|
||||
#include "TCPv6Monitor.h"
|
||||
#include "Common.h"
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getCounterList
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
list<wstring> counterList=TCPv6::GetCounterList();
|
||||
list<wstring>::iterator iter;
|
||||
long count=(long)counterList.size();
|
||||
jobjectArray array=environment->NewObjectArray(
|
||||
count,environment->FindClass("java/lang/String"),environment->NewStringUTF(""));
|
||||
int i=0;
|
||||
for(iter=counterList.begin();iter!=counterList.end();iter++)
|
||||
{
|
||||
environment->SetObjectArrayElement(array,i
|
||||
,environment->NewStringUTF(GetUTF8String((*iter).c_str())));
|
||||
i++;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv6::GetSegmentsPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsEstablished
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv6::GetConnectionsEstablished();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsActive
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv6::GetConnectionsActive();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsPassive
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv6::GetConnectionsPassive();
|
||||
}
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionFailures
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv6::GetConnectionFailures();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsReset
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv6::GetConnectionsReset();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsReceivedPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv6::GetSegmentsReceivedPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsSentPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv6::GetSegmentsSentPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsRetransmittedPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv6::GetSegmentsRetransmittedPerSecond(idleTime);
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class org_bench4q_monitor_performance_windows_TCPv6Monitor */
|
||||
|
||||
#ifndef _Included_org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
#define _Included_org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getCounterList
|
||||
* Signature: ()[Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getCounterList
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getSegmentsPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getConnectionsEstablished
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsEstablished
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getConnectionsActive
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsActive
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getConnectionsPassive
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsPassive
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getConnectionFailures
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionFailures
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getConnectionsReset
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getConnectionsReset
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getSegmentsReceivedPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsReceivedPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getSegmentsSentPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsSentPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv6Monitor
|
||||
* Method: getSegmentsRetransmittedPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv6Monitor_getSegmentsRetransmittedPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -5,7 +5,9 @@ import java.io.File;
|
|||
import org.bench4q.monitor.performance.windows.LogicalDiskMonitor;
|
||||
import org.bench4q.monitor.performance.windows.MemoryMonitor;
|
||||
import org.bench4q.monitor.performance.windows.NetworkInterfaceMonitor;
|
||||
import org.bench4q.monitor.performance.windows.PhysicalDiskMonitor;
|
||||
import org.bench4q.monitor.performance.windows.TCPv4Monitor;
|
||||
import org.bench4q.monitor.performance.windows.TCPv6Monitor;
|
||||
|
||||
public class Main {
|
||||
static {
|
||||
|
@ -86,12 +88,29 @@ public class Main {
|
|||
System.out.println(elem);
|
||||
}
|
||||
|
||||
PhysicalDiskMonitor physicalDiskMonitor = new PhysicalDiskMonitor();
|
||||
String[] physicalDiskInstances = physicalDiskMonitor.getInstances();
|
||||
for (String elem : physicalDiskInstances) {
|
||||
System.out.println(elem);
|
||||
}
|
||||
|
||||
String[] physicalDiskCounter = physicalDiskMonitor.getCounterList();
|
||||
for (String elem : physicalDiskCounter) {
|
||||
System.out.println(elem);
|
||||
}
|
||||
|
||||
TCPv4Monitor tcpv4Monitor = new TCPv4Monitor();
|
||||
String[] tcpv4Counter = tcpv4Monitor.getCounterList();
|
||||
for (String elem : tcpv4Counter) {
|
||||
System.out.println(elem);
|
||||
}
|
||||
|
||||
TCPv6Monitor tcpv6Monitor = new TCPv6Monitor();
|
||||
String[] tcpv6Counter = tcpv6Monitor.getCounterList();
|
||||
for (String elem : tcpv6Counter) {
|
||||
System.out.println(elem);
|
||||
}
|
||||
|
||||
MonitorServer monitorServer = new MonitorServer(5555);
|
||||
monitorServer.start();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue