"Fossies" - the Fresh Open Source Software Archive

Member "wrk-4.2.0/src/stats.h" (7 Feb 2021, 878 Bytes) of package /linux/www/wrk-4.2.0.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 "stats.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef STATS_H
    2 #define STATS_H
    3 
    4 #include <stdbool.h>
    5 #include <stdint.h>
    6 
    7 #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
    8 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
    9 
   10 typedef struct {
   11     uint32_t connect;
   12     uint32_t read;
   13     uint32_t write;
   14     uint32_t status;
   15     uint32_t timeout;
   16 } errors;
   17 
   18 typedef struct {
   19     uint64_t count;
   20     uint64_t limit;
   21     uint64_t min;
   22     uint64_t max;
   23     uint64_t data[];
   24 } stats;
   25 
   26 stats *stats_alloc(uint64_t);
   27 void stats_free(stats *);
   28 
   29 int stats_record(stats *, uint64_t);
   30 void stats_correct(stats *, int64_t);
   31 
   32 long double stats_mean(stats *);
   33 long double stats_stdev(stats *stats, long double);
   34 long double stats_within_stdev(stats *, long double, long double, uint64_t);
   35 uint64_t stats_percentile(stats *, long double);
   36 
   37 uint64_t stats_popcount(stats *);
   38 uint64_t stats_value_at(stats *stats, uint64_t, uint64_t *);
   39 
   40 #endif /* STATS_H */