github.com/isyscore/isc-gobase@v1.5.3-0.20231218061332-cbc7451899e9/system/disk/iostat_darwin.h (about)

     1  // https://github.com/lufia/iostat/blob/9f7362b77ad333b26c01c99de52a11bdb650ded2/iostat_darwin.h
     2  typedef struct DriveStats DriveStats;
     3  typedef struct CPUStats CPUStats;
     4  
     5  enum {
     6  	NDRIVE = 16,
     7  	NAMELEN = 31
     8  };
     9  
    10  struct DriveStats {
    11  	char name[NAMELEN+1];
    12  	int64_t size;
    13  	int64_t blocksize;
    14  
    15  	int64_t read;
    16  	int64_t written;
    17  	int64_t nread;
    18  	int64_t nwrite;
    19  	int64_t readtime;
    20  	int64_t writetime;
    21  	int64_t readlat;
    22  	int64_t writelat;
    23  };
    24  
    25  struct CPUStats {
    26  	natural_t user;
    27  	natural_t nice;
    28  	natural_t sys;
    29  	natural_t idle;
    30  };
    31  
    32  extern int readdrivestat(DriveStats a[], int n);
    33  extern int readcpustat(CPUStats *cpu);