Ignore:
Timestamp:
08/04/12 07:34:11 (10 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.1, 0.4.2
Children:
c91916f
Parents:
6aac723
Message:
  • Hopefully fixed the "cant load counter" issue by reowrking how counters are handled.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/CheckSystem/PDHCollector.h

    rc391984 ree230f7  
    2121#pragma once 
    2222 
     23#include <boost/thread.hpp> 
     24 
    2325#include <pdh.hpp> 
    24 #include <thread.h> 
    25 #include <MutexRW.h> 
    2626#include <boost/unordered_map.hpp> 
    2727#include <boost/shared_ptr.hpp> 
     
    105105    unsigned int check_intervall; 
    106106    std::wstring buffer_length; 
     107    std::wstring subsystem; 
    107108 
    108109    std::list<counter> counters; 
     
    111112private: 
    112113 
    113   //system_counter_data *data_; 
    114   MutexRW mutex_; 
    115   HANDLE hStopEvent_; 
     114  boost::shared_mutex mutex_; 
     115  HANDLE stop_event_; 
    116116  typedef boost::shared_ptr<PDHCollectors::PDHCollector> collector_ptr; 
    117117  typedef boost::unordered_map<std::wstring,collector_ptr > counter_map; 
    118118  counter_map counters_; 
    119119  int check_intervall_; 
     120  boost::shared_ptr<boost::thread> thread_; 
     121  boost::shared_ptr<system_counter_data> thread_data_; 
    120122 
    121123public: 
    122124  PDHCollector(); 
    123125  virtual ~PDHCollector(); 
    124   DWORD threadProc(LPVOID lpParameter); 
     126  void thread_proc(); 
    125127  void exitThread(void); 
    126128 
     
    135137  double get_avg_value(std::wstring counter, unsigned int delta); 
    136138  double get_double(std::wstring counter); 
     139  void start(boost::shared_ptr<system_counter_data> data); 
     140  bool stop(); 
    137141}; 
    138  
    139  
    140 typedef Thread<PDHCollector> PDHCollectorThread; 
Note: See TracChangeset for help on using the changeset viewer.