logical disk monitor completed.
This commit is contained in:
parent
89347b8d9d
commit
ae463b4b58
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
class Common
|
||||
class MONITOR_API Common
|
||||
{
|
||||
public:
|
||||
static double GetCounterValue(const wchar_t * fullCounterPath);
|
||||
|
|
|
@ -13,22 +13,255 @@ list<wstring> LogicalDisk::GetCounterList()
|
|||
return Common::GetCounterList(L"LogicalDisk");
|
||||
}
|
||||
|
||||
// % Free Space
|
||||
double LogicalDisk::GetFreeSpacePercent(wchar_t * instanceName)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\% Free Space";
|
||||
double ret=Common::GetCounterValue(fullCounterPath.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Free Megabytes
|
||||
double LogicalDisk::GetFreeMegabytes(wchar_t * instanceName)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Free Megabytes";
|
||||
double ret=Common::GetCounterValue(fullCounterPath.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Current Disk Queue Length
|
||||
double LogicalDisk::GetCurrentDiskQueueLength(wchar_t * instanceName)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Current Disk Queue Length";
|
||||
double ret=Common::GetCounterValue(fullCounterPath.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
||||
// % Disk Time
|
||||
double LogicalDisk::GetDiskTimePercent(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\% Disk Time";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Queue Length
|
||||
double LogicalDisk::GetAverageDiskQueueLength(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Queue Length";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// % Disk Read Time
|
||||
double LogicalDisk::GetDiskReadTimePercent(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\% Disk Read Time";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Read Queue Length
|
||||
double LogicalDisk::GetAverageDiskReadQueueLength(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Read Queue Length";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// % Disk Write Time
|
||||
double LogicalDisk::GetDiskWriteTimePercent(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\% Disk Write Time";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Write Queue Length
|
||||
double LogicalDisk::GetAverageDiskWriteQueueLength(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Write Queue Length";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk sec/Transfer
|
||||
double LogicalDisk::GetAverageDiskTransferTimeInSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk sec/Transfer";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk sec/Read
|
||||
double LogicalDisk::GetAverageDiskReadTimeInSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk sec/Read";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk sec/Write
|
||||
double LogicalDisk::GetAverageDiskWriteTimeInSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk sec/Write";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Transfers/sec
|
||||
double LogicalDisk::GetDiskTransfersPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Transfers/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Reads/sec
|
||||
double LogicalDisk::GetDiskReadsPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Reads/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Writes/sec
|
||||
double LogicalDisk::GetDiskWritesPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Writes/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Bytes/sec
|
||||
double LogicalDisk::GetDiskBytesPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Bytes/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Read Bytes/sec
|
||||
double LogicalDisk::GetDiskReadBytesPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Read Bytes/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Disk Write Bytes/sec
|
||||
double LogicalDisk::GetDiskWriteBytesPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Disk Write Bytes/sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Bytes/Transfer
|
||||
double LogicalDisk::GetAverageDiskBytesPerTransfer(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Bytes/Transfer";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Bytes/Read
|
||||
double LogicalDisk::GetAverageDiskBytesPerRead(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Bytes/Read";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Avg. Disk Bytes/Write
|
||||
double LogicalDisk::GetAverageDiskBytesPerWrite(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Avg. Disk Bytes/Write";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// % Idle Time
|
||||
double LogicalDisk::GetIdleTimePercent(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\% Idle Time";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Split IO/Sec
|
||||
double LogicalDisk::GetSplitIOPerSecond(wchar_t * instanceName, int idleTime)
|
||||
{
|
||||
wstring fullCounterPath(L"");
|
||||
fullCounterPath+=L"\\LogicalDisk(";
|
||||
fullCounterPath+=instanceName;
|
||||
fullCounterPath+=L")\\Split IO/Sec";
|
||||
double ret=Common::GetCounterValueWithIdle(fullCounterPath.c_str(),idleTime);
|
||||
return ret;
|
||||
}
|
|
@ -9,4 +9,27 @@ class MONITOR_API LogicalDisk
|
|||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double GetFreeSpacePercent(wchar_t * instanceName);
|
||||
static double GetFreeMegabytes(wchar_t * instanceName);
|
||||
static double GetCurrentDiskQueueLength(wchar_t * instanceName);
|
||||
static double GetDiskTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskTransferTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskTransfersPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadsPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWritesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerTransfer(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerRead(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerWrite(wchar_t * instanceName, int idleTime);
|
||||
static double GetIdleTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetSplitIOPerSecond(wchar_t * instanceName, int idleTime);
|
||||
};
|
|
@ -10,6 +10,73 @@
|
|||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class MONITOR_API Common
|
||||
{
|
||||
public:
|
||||
static double GetCounterValue(const wchar_t * fullCounterPath);
|
||||
static double GetCounterValueWithIdle(const wchar_t * fullCounterPath,int idleTime);
|
||||
static list<wstring> GetInstanceName(const wchar_t * objectName);
|
||||
static list<wstring> GetCounterList(const wchar_t * objectName);
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double GetFreeSpacePercent(wchar_t * instanceName);
|
||||
static double GetFreeMegabytes(wchar_t * instanceName);
|
||||
static double GetCurrentDiskQueueLength(wchar_t * instanceName);
|
||||
static double GetDiskTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskTransferTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskTransfersPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadsPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWritesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerTransfer(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerRead(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerWrite(wchar_t * instanceName, int idleTime);
|
||||
static double GetIdleTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetSplitIOPerSecond(wchar_t * instanceName, int idleTime);
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
||||
|
||||
class MONITOR_API Processor
|
||||
{
|
||||
public:
|
||||
|
@ -73,13 +140,6 @@ public:
|
|||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Tcp
|
||||
{
|
||||
public:
|
||||
|
@ -93,31 +153,3 @@ public:
|
|||
static list<wstring> GetCounterListForV4();
|
||||
static list<wstring> GetCounterListForV6();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
|
@ -13,6 +13,7 @@ list<wstring> PhysicalDisk::GetCounterList()
|
|||
return Common::GetCounterList(L"PhysicalDisk");
|
||||
}
|
||||
|
||||
// Current Disk Queue Length
|
||||
// % Disk Time
|
||||
// Avg. Disk Queue Length
|
||||
// % Disk Read Time
|
||||
|
|
|
@ -10,6 +10,73 @@
|
|||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class MONITOR_API Common
|
||||
{
|
||||
public:
|
||||
static double GetCounterValue(const wchar_t * fullCounterPath);
|
||||
static double GetCounterValueWithIdle(const wchar_t * fullCounterPath,int idleTime);
|
||||
static list<wstring> GetInstanceName(const wchar_t * objectName);
|
||||
static list<wstring> GetCounterList(const wchar_t * objectName);
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double GetFreeSpacePercent(wchar_t * instanceName);
|
||||
static double GetFreeMegabytes(wchar_t * instanceName);
|
||||
static double GetCurrentDiskQueueLength(wchar_t * instanceName);
|
||||
static double GetDiskTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskTransferTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskTransfersPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadsPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWritesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerTransfer(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerRead(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerWrite(wchar_t * instanceName, int idleTime);
|
||||
static double GetIdleTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetSplitIOPerSecond(wchar_t * instanceName, int idleTime);
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
||||
|
||||
class MONITOR_API Processor
|
||||
{
|
||||
public:
|
||||
|
@ -73,13 +140,6 @@ public:
|
|||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Tcp
|
||||
{
|
||||
public:
|
||||
|
@ -93,31 +153,3 @@ public:
|
|||
static list<wstring> GetCounterListForV4();
|
||||
static list<wstring> GetCounterListForV6();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
|
@ -10,6 +10,73 @@
|
|||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
class MONITOR_API Common
|
||||
{
|
||||
public:
|
||||
static double GetCounterValue(const wchar_t * fullCounterPath);
|
||||
static double GetCounterValueWithIdle(const wchar_t * fullCounterPath,int idleTime);
|
||||
static list<wstring> GetInstanceName(const wchar_t * objectName);
|
||||
static list<wstring> GetCounterList(const wchar_t * objectName);
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double GetFreeSpacePercent(wchar_t * instanceName);
|
||||
static double GetFreeMegabytes(wchar_t * instanceName);
|
||||
static double GetCurrentDiskQueueLength(wchar_t * instanceName);
|
||||
static double GetDiskTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteQueueLength(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskTransferTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskReadTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskWriteTimeInSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskTransfersPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadsPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWritesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskReadBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetDiskWriteBytesPerSecond(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerTransfer(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerRead(wchar_t * instanceName, int idleTime);
|
||||
static double GetAverageDiskBytesPerWrite(wchar_t * instanceName, int idleTime);
|
||||
static double GetIdleTimePercent(wchar_t * instanceName, int idleTime);
|
||||
static double GetSplitIOPerSecond(wchar_t * instanceName, int idleTime);
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
||||
|
||||
class MONITOR_API Processor
|
||||
{
|
||||
public:
|
||||
|
@ -73,13 +140,6 @@ public:
|
|||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API NetworkInterface
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Tcp
|
||||
{
|
||||
public:
|
||||
|
@ -93,31 +153,3 @@ public:
|
|||
static list<wstring> GetCounterListForV4();
|
||||
static list<wstring> GetCounterListForV6();
|
||||
};
|
||||
|
||||
class MONITOR_API PhysicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Memory
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API LogicalDisk
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
};
|
||||
|
||||
class MONITOR_API Process
|
||||
{
|
||||
public:
|
||||
static list<wstring> GetInstances();
|
||||
static list<wstring> GetCounterList();
|
||||
static double Process::GetProcessId(wchar_t * instanceName);
|
||||
};
|
|
@ -2,9 +2,22 @@
|
|||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
//list<wstring> counterList=PhysicalDisk::GetCounterList();
|
||||
//list<wstring> instances=Process::GetInstances();
|
||||
//list<wstring>::iterator iter;
|
||||
//std::wcout.imbue(std::locale("chs"));
|
||||
//for(iter=counterList.begin();iter!=counterList.end();iter++)
|
||||
//{
|
||||
// wcout<<(*iter).c_str()<<endl;
|
||||
//}
|
||||
//for(iter=instances.begin();iter!=instances.end();iter++)
|
||||
//{
|
||||
// wcout<<(*iter).c_str()<<endl;
|
||||
//}
|
||||
|
||||
while(1)
|
||||
{
|
||||
printf("%lf\n",ProcessorInformation::GetPriorityTimePercent(L"_Total",1000));
|
||||
printf("%lf\n",LogicalDisk::GetSplitIOPerSecond(L"_Total",1000));
|
||||
Sleep(500);
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue