diff --git a/WindowsMonitor/Test/MonitorApi.h b/WindowsMonitor/Test/MonitorApi.h deleted file mode 100644 index a54bb350..00000000 --- a/WindowsMonitor/Test/MonitorApi.h +++ /dev/null @@ -1,318 +0,0 @@ -#pragma once - -#ifdef MONITOR_EXPORTS -#define MONITOR_API __declspec(dllexport) -#else -#define MONITOR_API __declspec(dllimport) -#endif - -#include -#include -using namespace std; - -class MONITOR_API Common -{ -public: - static string WideStringToString(const wstring & str); - static wstring StringToWideString(const string & str); - static double GetCounterValue(const wchar_t * fullCounterPath); - static double GetCounterValueWithIdle(const wchar_t * fullCounterPath,int idleTime); - static list GetInstanceName(const wchar_t * objectName); - static list GetCounterList(const wchar_t * objectName); -}; - -class MONITOR_API LogicalDisk -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetFreeSpacePercent(const wchar_t * instanceName); - static double GetFreeMegabytes(const wchar_t * instanceName); - static double GetCurrentDiskQueueLength(const wchar_t * instanceName); - static double GetDiskTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskQueueLength(const wchar_t * instanceName, int idleTime); - static double GetDiskReadTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskReadQueueLength(const wchar_t * instanceName, int idleTime); - static double GetDiskWriteTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskWriteQueueLength(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskTransferTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskReadTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskWriteTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskTransfersPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskReadsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskWritesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskReadBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskWriteBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerTransfer(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerRead(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerWrite(const wchar_t * instanceName, int idleTime); - static double GetIdleTimePercent(const wchar_t * instanceName, int idleTime); - static double GetSplitIOPerSecond(const wchar_t * instanceName, int idleTime); -}; - -class MONITOR_API Memory -{ -public: - static list GetCounterList(); - static double GetPageFaultsPerSecond(int idleTime); - static double GetAvailableBytes(); - static double GetCommittedBytes(); - static double GetCommitLimit(); - static double GetWriteCopiesPerSecond(int idleTime); - static double GetTransitionFaultsPerSecond(int idleTime); - static double GetCacheFaultsPerSecond(int idleTime); - static double GetDemandZeroFaultsPerSecond(int idleTime); - static double GetPagesPerSecond(int idleTime); - static double GetPagesInputPerSecond(int idleTime); - static double GetPageReadsPerSecond(int idleTime); - static double GetPagesOutputPerSecond(int idleTime); - static double GetPoolPagedBytes(); - static double GetPoolNonpagedBytes(); - static double GetPageWritesPerSecond(int idleTime); - static double GetPoolPagedAllocs(); - static double GetPoolNonpagedAllocs(); - static double GetFreeSystemPageTableEntries(); - static double GetCacheBytes(); - static double GetCacheBytesPeak(); - static double GetPoolPagedResidentBytes(); - static double GetSystemCodeTotalBytes(); - static double GetSystemCodeResidentBytes(); - static double GetSystemDriverTotalBytes(); - static double GetSystemDriverResidentBytes(); - static double GetSystemCacheResidentBytes(); - static double GetCommittedBytesInUsePercent(); - static double GetAvailableKiloBytes(); - static double GetAvailableMegaBytes(); - static double GetTransitionPagesRepurposedPerSecond(int idleTime); - static double GetFreeAndZeroPageListBytes(); - static double GetModifiedPageListBytes(); - static double GetStandbyCacheReserveBytes(); - static double GetStandbyCacheNormalPriorityBytes(); - static double GetStandbyCacheCoreBytes(); - static double GetLongTermAverageStandbyCacheLifetimes(); -}; - -class MONITOR_API NetworkInterface -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetBytesTotalPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsReceivedPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsSentPerSecond(const wchar_t * instanceName, int idleTime); - static double GetCurrentBandwidth(const wchar_t * instanceName); - static double GetBytesReceivedPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsReceivedUnicastPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsReceivedNonUnicastPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsReceivedDiscarded(const wchar_t * instanceName); - static double GetPacketsReceivedErrors(const wchar_t * instanceName); - static double GetPacketsReceivedUnknown(const wchar_t * instanceName); - static double GetBytesSentPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsSentUnicastPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsSentNonUnicastPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPacketsOutboundDiscarded(const wchar_t * instanceName); - static double GetPacketsOutboundErrors(const wchar_t * instanceName); - static double GetOutputQueueLength(const wchar_t * instanceName); - static double GetOffloadedConnections(const wchar_t * instanceName); - static double GetTcpActiveRscConnections(const wchar_t * instanceName); - static double GetTcpRscCoalescedPacketsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetTcpRscExceptionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetTcpRscAveragePacketSize(const wchar_t * instanceName); -}; - -class MONITOR_API PhysicalDisk -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetCurrentDiskQueueLength(const wchar_t * instanceName); - static double GetDiskTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskQueueLength(const wchar_t * instanceName, int idleTime); - static double GetDiskReadTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskReadQueueLength(const wchar_t * instanceName, int idleTime); - static double GetDiskWriteTimePercent(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskWriteQueueLength(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskTransferTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskReadTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskWriteTimeInSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskTransfersPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskReadsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskWritesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskReadBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDiskWriteBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerTransfer(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerRead(const wchar_t * instanceName, int idleTime); - static double GetAverageDiskBytesPerWrite(const wchar_t * instanceName, int idleTime); - static double GetIdleTimePercent(const wchar_t * instanceName, int idleTime); - static double GetSplitIOPerSecond(const wchar_t * instanceName, int idleTime); -}; - -class MONITOR_API Process -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetProcessorTimePercent(const wchar_t * instanceName, int idleTime); - static double GetUserTimePercent(const wchar_t * instanceName, int idleTime); - static double GetPrivilegedTimePercent(const wchar_t * instanceName, int idleTime); - static double GetVirtualBytesPeak(const wchar_t * instanceName); - static double GetVirtualBytes(const wchar_t * instanceName); - static double GetPageFaultsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetWorkingSetPeak(const wchar_t * instanceName); - static double GetWorkingSet(const wchar_t * instanceName); - static double GetPageFileBytesPeak(const wchar_t * instanceName); - static double GetPageFileBytes(const wchar_t * instanceName); - static double GetPrivateBytes(const wchar_t * instanceName); - static double GetThreadCount(const wchar_t * instanceName); - static double GetPriorityBase(const wchar_t * instanceName); - static double GetElapsedTime(const wchar_t * instanceName); - static double GetProcessId(const wchar_t * instanceName); - static double GetCreatingProcessId(const wchar_t * instanceName); - static double GetPoolPagedBytes(const wchar_t * instanceName); - static double GetPoolNonpagedBytes(const wchar_t * instanceName); - static double GetHandleCount(const wchar_t * instanceName); - static double GetIOReadOperationsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIOWriteOperationsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIODataOperationsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIOOtherOperationsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIOReadBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIOWriteBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIODataBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetIOOtherBytesPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPrivateWorkingSet(const wchar_t * instanceName); -}; - -class MONITOR_API Processor -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetProcessorTimePercent(const wchar_t * instanceName, int idleTime); - static double GetUserTimePercent(const wchar_t * instanceName, int idleTime); - static double GetPrivilegedTimePercent(const wchar_t * instanceName, int idleTime); - static double GetInterruptsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDpcTimePercent(const wchar_t * instanceName, int idleTime); - static double GetInterruptTimePercent(const wchar_t * instanceName, int idleTime); - static double GetDpcsQueuedPerSecond(const wchar_t * instanceName, int idleTime); - static double GetDpcRate(const wchar_t * instanceName); - static double GetIdleTimePercent(const wchar_t * instanceName, int idleTime); - static double GetC1TimePercent(const wchar_t * instanceName, int idleTime); - static double GetC2TimePercent(const wchar_t * instanceName, int idleTime); - static double GetC3TimePercent(const wchar_t * instanceName, int idleTime); - static double GetC1TransitionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetC2TransitionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetC3TransitionsPerSecond(const wchar_t * instanceName, int idleTime); -}; - -class MONITOR_API ProcessorInformation -{ -public: - static list GetInstances(); - static list GetCounterList(); - static double GetPerformanceLimitFlags(const wchar_t * instanceName); - static double GetPerformanceLimitPercent(const wchar_t * instanceName); - static double GetPrivilegedUtilityPercent(const wchar_t * instanceName, int idleTime); - static double GetProcessorUtilityPercent(const wchar_t * instanceName, int idleTime); - static double GetProcessorPerformancePercent(const wchar_t * instanceName, int idleTime); - static double GetIdleBreakEventsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetAverageIdleTime(const wchar_t * instanceName, int idleTime); - static double GetClockInterruptsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetProcessorStateFlags(const wchar_t * instanceName); - static double GetPercentageOfMaximumFrequency(const wchar_t * instanceName); - static double GetProcessorFrequency(const wchar_t * instanceName); - static double GetParkingStatus(const wchar_t * instanceName); - static double GetPriorityTimePercent(const wchar_t * instanceName, int idleTime); - static double GetC3TransitionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetC2TransitionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetC1TransitionsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetC3TimePercent(const wchar_t * instanceName, int idleTime); - static double GetC2TimePercent(const wchar_t * instanceName, int idleTime); - static double GetC1TimePercent(const wchar_t * instanceName, int idleTime); - static double GetIdleTimePercent(const wchar_t * instanceName, int idleTime); - static double GetDpcRate(const wchar_t * instanceName); - static double GetDpcsQueuedPerSecond(const wchar_t * instanceName, int idleTime); - static double GetInterruptTimePercent(const wchar_t * instanceName, int idleTime); - static double GetDpcTimePercent(const wchar_t * instanceName, int idleTime); - static double GetInterruptsPerSecond(const wchar_t * instanceName, int idleTime); - static double GetPrivilegedTimePercent(const wchar_t * instanceName, int idleTime); - static double GetUserTimePercent(const wchar_t * instanceName, int idleTime); - static double GetProcessorTimePercent(const wchar_t * instanceName, int idleTime); -}; - -class MONITOR_API System -{ -public: - static list GetCounterList(); - static double GetFileReadOperationsPerSecond(int idleTime); - static double GetFileWriteOperationsPerSecond(int idleTime); - static double GetFileControlOperationsPerSecond(int idleTime); - static double GetFileReadBytesPerSecond(int idleTime); - static double GetFileWriteBytesPerSecond(int idleTime); - static double GetFileControlBytesPerSecond(int idleTime); - static double GetContextSwitchesPerSecond(int idleTime); - static double GetSystemCallsPerSecond(int idleTime); - static double GetFileDataOperationsPerSecond(int idleTime); - static double GetSystemUpTime(); - static double GetProcessorQueueLength(); - static double GetProcessesCount(); - static double GetThreadsCount(); - static double GetAlignmentFixupsPerSecond(int idleTime); - static double GetExceptionDispatchesPerSecond(int idleTime); - static double GetFloatingEmulationsPerSecond(int idleTime); - static double GetRegistryQuotaInUsePercent(); -}; - -class MONITOR_API TCPv4 -{ -public: - static list GetCounterList(); - static double GetSegmentsPerSecond(int idleTime); - static double GetConnectionsEstablished(); - static double GetConnectionsActive(); - static double GetConnectionsPassive(); - static double GetConnectionFailures(); - static double GetConnectionsReset(); - static double GetSegmentsReceivedPerSecond(int idleTime); - static double GetSegmentsSentPerSecond(int idleTime); - static double GetSegmentsRetransmittedPerSecond(int idleTime); -}; - -class MONITOR_API TCPv6 -{ -public: - static list GetCounterList(); - static double GetSegmentsPerSecond(int idleTime); - static double GetConnectionsEstablished(); - static double GetConnectionsActive(); - static double GetConnectionsPassive(); - static double GetConnectionFailures(); - static double GetConnectionsReset(); - static double GetSegmentsReceivedPerSecond(int idleTime); - static double GetSegmentsSentPerSecond(int idleTime); - static double GetSegmentsRetransmittedPerSecond(int idleTime); -}; - -class MONITOR_API UDPv4 -{ -public: - static list GetCounterList(); - static double GetDatagramsPerSecond(int idleTime); - static double GetDatagramsReceivedPerSecond(int idleTime); - static double GetDatagramsNoPortPerSecond(int idleTime); - static double GetDatagramsReceivedErrors(); - static double GetDatagramsSentPerSecond(int idleTime); -}; - -class MONITOR_API UDPv6 -{ -public: - static list GetCounterList(); - static double GetDatagramsPerSecond(int idleTime); - static double GetDatagramsReceivedPerSecond(int idleTime); - static double GetDatagramsNoPortPerSecond(int idleTime); - static double GetDatagramsReceivedErrors(); - static double GetDatagramsSentPerSecond(int idleTime); -}; \ No newline at end of file diff --git a/WindowsMonitor/Test/Test.cpp b/WindowsMonitor/Test/Test.cpp deleted file mode 100644 index 239c5288..00000000 --- a/WindowsMonitor/Test/Test.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "stdafx.h" - -int _tmain(int argc, _TCHAR* argv[]) -{ - list counterList=UDPv6::GetCounterList(); - list::iterator iter; - std::wcout.imbue(std::locale("chs")); - for(iter=counterList.begin();iter!=counterList.end();iter++) - { - wcout<<(*iter).c_str()< - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {50CE9AFE-3102-4568-8107-2E3D77F2FC22} - Win32Proj - Test - - - - Application - true - v110 - Unicode - - - Application - true - v110 - Unicode - - - Application - false - v110 - true - Unicode - - - Application - false - v110 - true - Unicode - - - - - - - - - - - - - - - - - - - true - - - true - AllRules.ruleset - true - - - false - - - false - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - true - - - Console - true - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - Create - Create - Create - Create - - - - - - - \ No newline at end of file diff --git a/WindowsMonitor/Test/Test.vcxproj.filters b/WindowsMonitor/Test/Test.vcxproj.filters deleted file mode 100644 index fbf733de..00000000 --- a/WindowsMonitor/Test/Test.vcxproj.filters +++ /dev/null @@ -1,33 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - 头文件 - - - 头文件 - - - - - 源文件 - - - 源文件 - - - \ No newline at end of file diff --git a/WindowsMonitor/Test/Test.vcxproj.user b/WindowsMonitor/Test/Test.vcxproj.user deleted file mode 100644 index a375ae35..00000000 --- a/WindowsMonitor/Test/Test.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/WindowsMonitor/Test/stdafx.cpp b/WindowsMonitor/Test/stdafx.cpp deleted file mode 100644 index fd4f341c..00000000 --- a/WindowsMonitor/Test/stdafx.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "stdafx.h" diff --git a/WindowsMonitor/Test/stdafx.h b/WindowsMonitor/Test/stdafx.h deleted file mode 100644 index afddbae4..00000000 --- a/WindowsMonitor/Test/stdafx.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#ifdef _DEBUG -#ifdef _WIN64 -#pragma comment(lib,"../x64/Debug/Monitor.lib") -#else -#pragma comment(lib,"../Debug/Monitor.lib") -#endif -#else -#ifdef _WIN64 -#pragma comment(lib,"../x64/Release/Monitor.lib") -#else -#pragma comment(lib,"../Release/Monitor.lib") -#endif -#endif - -#include -#include -#include - -using namespace std; - -#include "MonitorApi.h" \ No newline at end of file