fix the tcpv4 monitor
This commit is contained in:
parent
a62bd37bad
commit
01e9cec754
|
@ -0,0 +1,75 @@
|
|||
#include "stdafx.h"
|
||||
#include "TCPv4Monitor.h"
|
||||
#include "Common.h"
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getCounterList
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
list<wstring> counterList=TCPv4::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_TCPv4Monitor_getSegmentsPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv4::GetSegmentsPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsEstablished
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv4::GetConnectionsEstablished();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsActive
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv4::GetConnectionsActive();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsPassive
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv4::GetConnectionsPassive();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionFailures
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv4::GetConnectionFailures();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsReset
|
||||
(JNIEnv * environment, jobject object)
|
||||
{
|
||||
return TCPv4::GetConnectionsReset();
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsReceivedPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv4::GetSegmentsReceivedPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsSentPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv4::GetSegmentsSentPerSecond(idleTime);
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsRetransmittedPerSecond
|
||||
(JNIEnv * environment, jobject object, jint idleTime)
|
||||
{
|
||||
return TCPv4::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_TCPv4Monitor */
|
||||
|
||||
#ifndef _Included_org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
#define _Included_org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getCounterList
|
||||
* Signature: ()[Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jobjectArray JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getCounterList
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getSegmentsPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getConnectionsEstablished
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsEstablished
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getConnectionsActive
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsActive
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getConnectionsPassive
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsPassive
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getConnectionFailures
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionFailures
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getConnectionsReset
|
||||
* Signature: ()D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getConnectionsReset
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getSegmentsReceivedPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsReceivedPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getSegmentsSentPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsSentPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: org_bench4q_monitor_performance_windows_TCPv4Monitor
|
||||
* Method: getSegmentsRetransmittedPerSecond
|
||||
* Signature: (I)D
|
||||
*/
|
||||
JNIEXPORT jdouble JNICALL Java_org_bench4q_monitor_performance_windows_TCPv4Monitor_getSegmentsRetransmittedPerSecond
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in New Issue