"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/sunos5/cpumeter.h" (11 Jul 2020, 688 Bytes) of package /linux/misc/xosview-1.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cpumeter.h" see the Fossies "Dox" file reference documentation.

    1 //  
    2 //  Initial port performed by Greg Onufer (exodus@cheers.bungi.com)
    3 //
    4 #ifndef _CPUMETER_H_
    5 #define _CPUMETER_H_
    6 
    7 #include "fieldmetergraph.h"
    8 #include "xosview.h"
    9 #include "kstats.h"
   10 #include <kstat.h>
   11 #include <sys/sysinfo.h>
   12 
   13 
   14 class CPUMeter : public FieldMeterGraph {
   15  public:
   16     CPUMeter(XOSView *parent, kstat_ctl_t *kcp, int cpuid = 0);
   17     ~CPUMeter(void);
   18 
   19     const char *name(void) const { return "CPUMeter"; }
   20     void checkevent(void);
   21     void checkResources(void);
   22     static const char *cpuStr(int num);
   23 
   24  protected:
   25     float cputime_[2][CPU_STATES];
   26     int cpuindex_;
   27 
   28     void getcputime(void);
   29 
   30  private:
   31     KStatList *cpustats;
   32     bool aggregate;
   33     kstat_ctl_t *kc;
   34     kstat_t *ksp;
   35 };
   36 
   37 #endif