|
Last change
on this file since 3b8eb61 was
3b8eb61,
checked in by Michael Medin <michael@…>, 8 years ago
|
|
2005-05-18 MickeM
- Fixed bug in NSC.ini (section title for Check System was wrong)
+ Added multitasking for plugins (now two plugins can handle requests simultaniously)
- Fixed som minor issues here and there
|
-
Property mode set to
100644
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | #pragma once |
|---|
| 2 | |
|---|
| 3 | #include "PDHCollectors.h" |
|---|
| 4 | #include <thread.h> |
|---|
| 5 | #include <Mutex.h> |
|---|
| 6 | |
|---|
| 7 | /** |
|---|
| 8 | * @ingroup NSClientCompat |
|---|
| 9 | * PDH collector thread (gathers performance data and allows for clients to retrieve it) |
|---|
| 10 | * |
|---|
| 11 | * @version 1.0 |
|---|
| 12 | * first version |
|---|
| 13 | * |
|---|
| 14 | * @date 02-13-2005 |
|---|
| 15 | * |
|---|
| 16 | * @author mickem |
|---|
| 17 | * |
|---|
| 18 | * @par license |
|---|
| 19 | * This code is absolutely free to use and modify. The code is provided "as is" with |
|---|
| 20 | * no expressed or implied warranty. The author accepts no liability if it causes |
|---|
| 21 | * any damage to your computer, causes your pet to fall ill, increases baldness |
|---|
| 22 | * or makes your car start emitting strange noises when you start it up. |
|---|
| 23 | * This code has no bugs, just undocumented features! |
|---|
| 24 | * |
|---|
| 25 | */ |
|---|
| 26 | class PDHCollector { |
|---|
| 27 | private: |
|---|
| 28 | MutexHandler mutexHandler; |
|---|
| 29 | HANDLE hStopEvent_; |
|---|
| 30 | int checkIntervall_; |
|---|
| 31 | |
|---|
| 32 | PDHCollectors::StaticPDHCounterListener memCmtLim; |
|---|
| 33 | PDHCollectors::StaticPDHCounterListener memCmt; |
|---|
| 34 | PDHCollectors::StaticPDHCounterListener upTime; |
|---|
| 35 | PDHCollectors::RoundINTPDHBufferListener cpu; |
|---|
| 36 | |
|---|
| 37 | public: |
|---|
| 38 | PDHCollector(); |
|---|
| 39 | virtual ~PDHCollector(); |
|---|
| 40 | DWORD threadProc(LPVOID lpParameter); |
|---|
| 41 | void exitThread(void); |
|---|
| 42 | |
|---|
| 43 | // Retrieve values |
|---|
| 44 | int getCPUAvrage(std::string time); |
|---|
| 45 | long long getUptime(); |
|---|
| 46 | long long getMemCommitLimit(); |
|---|
| 47 | long long getMemCommit(); |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | private: |
|---|
| 51 | // bool isRunning(void); |
|---|
| 52 | // void startRunning(void); |
|---|
| 53 | // void stopRunning(void); |
|---|
| 54 | |
|---|
| 55 | }; |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | typedef Thread<PDHCollector> PDHCollectorThread; |
|---|
Note: See
TracBrowser
for help on using the repository browser.