-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.h
70 lines (41 loc) · 1.14 KB
/
stats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef STATS_H
#define STATS_H 1
#define RESULT_HEADERS "Addresses,Streams,PacketLoss,AverageBitrate/Stream(mbps),AggregateBitrate(mbps),RollingJitter(ms),MinJit,Q1Jit,MedJit,Q3Jit,MaxJit,StddevJit,MeanJit"
typedef struct {
int addresses;
int streams;
float min;
float q1;
float median;
float q3;
float max;
float rollingJitter;
float stddev;
float mean;
float loss;
float bitrate;
float aggrBitrate;
} McastResult;
typedef struct {
long used;
long size;
float *jitters;
float rollingJitter;
long rcvd;
long lost;
double ttime;
long bytes;
} McastStat;
int compare_floats (const void *a, const void *b);
McastStat *createMcastStat(int jitterStat);
void insertJitter(McastStat *j, float jitter);
float computeBitrate(McastStat *s);
float computeLoss(McastStat *s);
float computeMedian(float *arr, int s, int e);
McastResult* computeMcastResult(McastStat *j, int naddr, int streams);
void freeMcastStat(McastStat *j);
void print_results(McastResult **rs, int n_test, FILE *fd, int json);
char* result_to_json(McastResult *r);
char * result_to_csv(McastResult *r);
void disp_results(McastResult *j);
#endif