home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / netper21.zip / hist.h < prev    next >
C/C++ Source or Header  |  1994-08-26  |  1KB  |  64 lines

  1. /* hist.h
  2.  
  3.    Given a time difference in microseconds, increment one of 61
  4.    different buckets: 
  5.    
  6.    0 - 9 in increments of 100 usecs
  7.    0 - 9 in increments of 1 msec
  8.    0 - 9 in increments of 10 msecs
  9.    0 - 9 in increments of 100 msecs
  10.    0 - 9 in increments of 1 sec
  11.    0 - 9 in increments of 10 sec
  12.    > 100 secs
  13.    
  14.    This will allow any time to be recorded to within an accuracy of
  15.    10%, and provides a compact representation for capturing the
  16.    distribution of a large number of time differences (e.g.
  17.    request-response latencies).
  18.    
  19.    Colin Low  10/6/93
  20. */
  21. #ifndef _HIST_INCLUDED
  22. #define _HIST_INCLUDED
  23.    
  24. struct histogram_struct {
  25.    int tenth_msec[10];
  26.    int unit_msec[10];
  27.    int ten_msec[10];
  28.    int hundred_msec[10];
  29.    int unit_sec[10];
  30.    int ten_sec[10];
  31.    int ridiculous;
  32.    int total;
  33. };
  34.  
  35. typedef struct histogram_struct *HIST;
  36.  
  37. /* 
  38.    HIST_new - return a new, cleared histogram data type
  39. */
  40.  
  41. HIST HIST_new(void); 
  42.  
  43. /* 
  44.    HIST_clear - reset a histogram by clearing all totals to zero
  45. */
  46.  
  47. void HIST_clear(HIST h);
  48.  
  49. /*
  50.    HIST_add - add a time difference to a histogram. Time should be in
  51.    microseconds. 
  52. */
  53.  
  54. void HIST_add(register HIST h, int time_delta);
  55.  
  56. /* 
  57.   HIST_report - create an ASCII report on the contents of a histogram.
  58.   Currently printsto standard out 
  59. */
  60.  
  61. void HIST_report(HIST h);
  62.  
  63. #endif
  64.