"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/linux/diskmeter.h" (11 Jul 2020, 1177 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 "diskmeter.h" see the Fossies "Dox" file reference documentation.

    1 //
    2 //  Copyright (c) 1999, 2006 by Mike Romberg (mike.romberg@noaa.gov)
    3 //
    4 //  This file may be distributed under terms of the GPL
    5 //
    6 
    7 #ifndef _DISKMETER_H_
    8 #define _DISKMETER_H_
    9 
   10 #include "fieldmetergraph.h"
   11 #include "xosview.h"
   12 #include <map>
   13 #include <string>
   14 
   15 typedef std::map<std::string, unsigned long> diskmap;
   16 
   17 
   18 class DiskMeter : public FieldMeterGraph
   19     {
   20     public:
   21         DiskMeter( XOSView *parent, float max );
   22         ~DiskMeter( void );
   23 
   24         const char *name( void ) const { return "DiskMeter"; }
   25         void checkevent( void );
   26 
   27         void checkResources( void );
   28     protected:
   29 
   30         // sysfs:
   31         void update_info(const diskmap &reads, const diskmap &writes);
   32         void getsysfsdiskinfo( void );
   33 
   34         void getdiskinfo( void );
   35         void getvmdiskinfo( void );
   36         void updateinfo(unsigned long one, unsigned long two,
   37           int fudgeFactor);
   38     private:
   39 
   40         // sysfs:
   41         diskmap sysfs_read_prev_, sysfs_write_prev_;
   42         bool _sysfs;
   43 
   44         unsigned long int read_prev_;
   45         unsigned long int write_prev_;
   46         float maxspeed_;
   47         bool _vmstat;
   48         const char *_statFileName;
   49     };
   50 
   51 #endif