libcommonc++  0.7
LoadAverageStats.h++
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------
2  commonc++ - A C++ Common Class Library
3  Copyright (C) 2005-2014 Mark A Lindner
4 
5  This file is part of commonc++.
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public
18  License along with this library; if not, write to the Free
19  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  ---------------------------------------------------------------------------
21 */
22 
23 #ifndef __ccxx_LoadAverageStats_hxx
24 #define __ccxx_LoadAverageStats_hxx
25 
27 
28 namespace ccxx {
29 
38 {
39  public:
40 
43 
46 
48  inline double getLoad1Min() const
49  { return(_load1Min); }
50 
52  inline double getLoad5Min() const
53  { return(_load5Min); }
54 
56  inline double getLoad15Min() const
57  { return(_load15Min); }
58 
59  bool collect();
60  void reset();
61 
62  private:
63 
64  double _load1Min;
65  double _load5Min;
66  double _load15Min;
67 
69 };
70 
71 } // namespace ccxx
72 
73 #endif // __ccxx_LoadAverageStats_hxx
A collector of system performance or resource utilization statistics.
Definition: SystemStats.h++:37
double getLoad1Min() const
Get the load average over the last 1 minute period.
Definition: LoadAverageStats.h++:48
double getLoad5Min() const
Get the load average over the last 5 minute period.
Definition: LoadAverageStats.h++:52
System "load average" statistics.
Definition: LoadAverageStats.h++:37
#define COMMONCPP_API
Definition: Common.h++:126
#define CCXX_COPY_DECLS(CLASS)
Inlines declarations of a copy constructor and assignment operator for the class CLASS.
Definition: Common.h++:295
Definition: AllocationMap.c++:25
double getLoad15Min() const
Get the load average over the last 15 minute period.
Definition: LoadAverageStats.h++:56