tcpv6 monitor updated.

This commit is contained in:
Zhen Tang 2013-07-09 22:18:09 +08:00
parent 9d36ca60b4
commit a57090fdab
4 changed files with 192 additions and 104 deletions

View File

@ -9,154 +9,154 @@ list<wstring> System::GetCounterList()
}
// File Read Operations/sec
double System::GetFileReadOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Read Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileReadOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Read Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Write Operations/sec
double System::GetFileWriteOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Write Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileWriteOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Write Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Control Operations/sec
double System::GetFileControlOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Control Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileControlOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Control Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Read Bytes/sec
double System::GetFileReadBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Read Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileReadBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Read Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Write Bytes/sec
double System::GetFileWriteBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Write Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileWriteBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Write Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Control Bytes/sec
double System::GetFileControlBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Control Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileControlBytesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Control Bytes/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Context Switches/sec
double System::GetContextSwitchesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Context Switches/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetContextSwitchesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Context Switches/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// System Calls/sec
double System::GetSystemCallsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\System Calls/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetSystemCallsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\System Calls/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// File Data Operations/sec
double System::GetFileDataOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Data Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFileDataOperationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\File Data Operations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// System Up Time
double System::GetSystemUpTime()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\System Up Time";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
double System::GetSystemUpTime()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\System Up Time";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Processor Queue Length
double System::GetProcessorQueueLength()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Processor Queue Length";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
double System::GetProcessorQueueLength()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Processor Queue Length";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Processes
double System::GetProcessesCount()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Processes";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
double System::GetProcessesCount()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Processes";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Threads
double System::GetThreadsCount()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Threads";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
double System::GetThreadsCount()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Threads";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Alignment Fixups/sec
double System::GetAlignmentFixupsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Alignment Fixups/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetAlignmentFixupsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Alignment Fixups/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Exception Dispatches/sec
double System::GetExceptionDispatchesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Exception Dispatches/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetExceptionDispatchesPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Exception Dispatches/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Floating Emulations/sec
double System::GetFloatingEmulationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Floating Emulations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
double System::GetFloatingEmulationsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\Floating Emulations/sec";
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// % Registry Quota In Use
double System::GetRegistryQuotaInUsePercent()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\% Registry Quota In Use";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
double System::GetRegistryQuotaInUsePercent()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\System\\% Registry Quota In Use";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}

View File

@ -9,11 +9,86 @@ list<wstring> TCPv6::GetCounterList()
}
// Segments/sec
double TCPv6::GetSegmentsPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Segments/sec";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
//double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Connections Established
double TCPv6::GetConnectionsEstablished()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Connections Established";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Connections Active
double TCPv6::GetConnectionsActive()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Connections Active";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Connections Passive
double TCPv6::GetConnectionsPassive()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Connections Passive";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Connection Failures
double TCPv6::GetConnectionFailures()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Connection Failures";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Connections Reset
double TCPv6::GetConnectionsReset()
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Connections Reset";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
return ret;
}
// Segments Received/sec
double TCPv6::GetSegmentsReceivedPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Segments Received/sec";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
//double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Segments Sent/sec
// Segments Retransmitted/sec
double TCPv6::GetSegmentsSentPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Segments Sent/sec";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
//double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}
// Segments Retransmitted/sec
double TCPv6::GetSegmentsRetransmittedPerSecond(int idleTime)
{
wstring fullCounterPath(L"");
fullCounterPath+=L"\\TCPv6\\Segments Retransmitted/sec";
double ret=Common::GetCounterValue(fullCounterPath.c_str());
//double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
return ret;
}

View File

@ -8,4 +8,13 @@ class MONITOR_API TCPv6
{
public:
static list<wstring> GetCounterList();
double TCPv6::GetSegmentsPerSecond(int idleTime);
double TCPv6::GetConnectionsEstablished();
double TCPv6::GetConnectionsActive();
double TCPv6::GetConnectionsPassive();
double TCPv6::GetConnectionFailures();
double TCPv6::GetConnectionsReset();
double TCPv6::GetSegmentsReceivedPerSecond(int idleTime);
double TCPv6::GetSegmentsSentPerSecond(int idleTime);
double TCPv6::GetSegmentsRetransmittedPerSecond(int idleTime);
};

View File

@ -7,7 +7,11 @@ char * GetJString(JNIEnv * environment, jstring str)
const jchar * jcstr=environment->GetStringChars(str,NULL);
int size=0;
char * ret=(char *)malloc(length*2+1);
if((size=WideCharToMultiByte(CP_ACP,0,LPCWSTR(jcstr),length,ret,length*2+1,NULL,NULL))==0)
if(ret==NULL)
{
return NULL;
}
if((size=WideCharToMultiByte(CP_ACP,0,(wchar_t *)jcstr,length,ret,length*2+1,NULL,NULL))==0)
{
return NULL;
}