jni adapter for tcpv4 monitor added.

This commit is contained in:
Zhen Tang 2013-07-10 00:02:20 +08:00
parent 25a76f8a97
commit 4624ee9288
7 changed files with 45 additions and 2 deletions

View File

@ -153,6 +153,7 @@
<ClInclude Include="Native.h" />
<ClInclude Include="NetworkInterfaceMonitor.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="TCPv4Monitor.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Common.cpp" />
@ -179,6 +180,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TCPv4Monitor.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -36,6 +36,9 @@
<ClInclude Include="Common.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="TCPv4Monitor.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@ -56,5 +59,8 @@
<ClCompile Include="Common.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="TCPv4Monitor.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -5,6 +5,7 @@ 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.TCPv4Monitor;
public class Main {
static {
@ -85,6 +86,12 @@ public class Main {
System.out.println(elem);
}
TCPv4Monitor tcpv4Monitor = new TCPv4Monitor();
String[] tcpv4Counter = tcpv4Monitor.getCounterList();
for (String elem : tcpv4Counter) {
System.out.println(elem);
}
MonitorServer monitorServer = new MonitorServer(5555);
monitorServer.start();
}

View File

@ -0,0 +1,23 @@
package org.bench4q.monitor.performance.windows;
public class TCPv4Monitor {
public native String[] getCounterList();
public native double getSegmentsPerSecond(int idleTime);
public native double getConnectionsEstablished();
public native double getConnectionsActive();
public native double getConnectionsPassive();
public native double getConnectionFailures();
public native double getConnectionsReset();
public native double getSegmentsReceivedPerSecond(int idleTime);
public native double getSegmentsSentPerSecond(int idleTime);
public native double getSegmentsRetransmittedPerSecond(int idleTime);
}

View File

@ -1,5 +1,5 @@
package org.bench4q.monitor.performance.windows;
public class TcpMonitor {
public class TCPv6Monitor {
}

View File

@ -1,5 +1,5 @@
package org.bench4q.monitor.performance.windows;
public class UdpMonitor {
public class UDPv4Monitor {
}

View File

@ -0,0 +1,5 @@
package org.bench4q.monitor.performance.windows;
public class UDPv6Monitor {
}