Revision 7c2659b9 measures.c

View differences:

measures.c
4 4
#include "dbg.h"
5 5
#include <net_helper.h>
6 6

  
7
static char* channel = "OfferStreamer";
8

  
7 9
typedef struct nodeID {
8 10
	socketID_handle addr;
9 11
	int connID;	// connection associated to this node, -1 if myself
......
21 23
		enum stat_types st[] = {SUM};
22 24
		chunk_dup = monCreateMeasure(GENERIC, 0);
23 25
		monSetParameter (chunk_dup, P_PUBLISHING_RATE, 120);
24
		monPublishStatisticalType(chunk_dup, "ChunkDuplicates", "OfferStreamer", st , sizeof(st)/sizeof(enum stat_types), NULL);
26
		monPublishStatisticalType(chunk_dup, "ChunkDuplicates", channel, st , sizeof(st)/sizeof(enum stat_types), NULL);
25 27
		monActivateMeasure(chunk_dup, NULL, MSG_TYPE_ANY);
26 28
	}
27 29
	monNewSample(chunk_dup, 1);
......
33 35
		enum stat_types st[] = {AVG, SUM};
34 36
		chunk_playout = monCreateMeasure(GENERIC, 0);
35 37
		monSetParameter (chunk_playout, P_PUBLISHING_RATE, 120);
36
		monPublishStatisticalType(chunk_playout, "ChunksPlayed", "OfferStreamer", st , sizeof(st)/sizeof(enum stat_types), NULL);
38
		monPublishStatisticalType(chunk_playout, "ChunksPlayed", channel, st , sizeof(st)/sizeof(enum stat_types), NULL);
37 39
		monActivateMeasure(chunk_playout, NULL, MSG_TYPE_ANY);
38 40
	}
39 41
	monNewSample(chunk_playout, b);
......
45 47
		enum stat_types st[] = {LAST};
46 48
		neigh_size = monCreateMeasure(GENERIC, 0);
47 49
		monSetParameter (neigh_size, P_PUBLISHING_RATE, 120);
48
		monPublishStatisticalType(neigh_size, "NeighSize", "OfferStreamer", st , sizeof(st)/sizeof(enum stat_types), NULL);
50
		monPublishStatisticalType(neigh_size, "NeighSize", channel, st , sizeof(st)/sizeof(enum stat_types), NULL);
49 51
		monActivateMeasure(neigh_size, NULL, MSG_TYPE_ANY);
50 52
	}
51 53
	monNewSample(neigh_size, s);
......
64 66
	id->mhs[j] = monCreateMeasure(HOPCOUNT, TXRXUNI | PACKET | IN_BAND);
65 67
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
66 68
	//Uncomment the following line to publish results
67
	monPublishStatisticalType(id->mhs[j], NULL, "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
69
	monPublishStatisticalType(id->mhs[j], NULL, channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
68 70
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
69 71
	j++;
70 72

  
......
72 74
	id->mhs[j] = monCreateMeasure(RTT, TXRXBI | PACKET | IN_BAND);
73 75
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 60);
74 76
	//Uncomment the following line to publish results
75
	monPublishStatisticalType(id->mhs[j], "RoundTripDelay", "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
77
	monPublishStatisticalType(id->mhs[j], "RoundTripDelay", channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
76 78
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_SIGNALLING);
77 79
	j++;
78 80

  
......
80 82
	id->mhs[j] = monCreateMeasure(LOSS, TXRXUNI | PACKET | IN_BAND);
81 83
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 60);
82 84
	//Uncomment the following line to publish results
83
	monPublishStatisticalType(id->mhs[j], NULL, "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
85
	monPublishStatisticalType(id->mhs[j], NULL, channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
84 86
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
85 87
	j++;
86 88

  
......
88 90
//	id->mhs[j] = monCreateMeasure(BYTE, RXONLY | PACKET | IN_BAND);
89 91
//	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 120);
90 92
	//Uncomment the following line to publish results
91
//	monPublishStatisticalType(id->mhs[j], "RxBytes", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
93
//	monPublishStatisticalType(id->mhs[j], "RxBytes", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
92 94
//	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_ANY);
93 95
//	j++;
94 96

  
......
96 98
//	id->mhs[j] = monCreateMeasure(BYTE, TXONLY | PACKET | IN_BAND);
97 99
//	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 120);
98 100
	//Uncomment the following line to publish results
99
//	monPublishStatisticalType(id->mhs[j], "TxBytes", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
101
//	monPublishStatisticalType(id->mhs[j], "TxBytes", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
100 102
//	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_ANY);
101 103
//	j++;
102 104

  
......
104 106
	id->mhs[j] = monCreateMeasure(BYTE, RXONLY | PACKET | IN_BAND);
105 107
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
106 108
	//Uncomment the following line to publish results
107
	monPublishStatisticalType(id->mhs[j], "RxBytesChunk", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
109
	monPublishStatisticalType(id->mhs[j], "RxBytesChunk", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
108 110
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
109 111
	j++;
110 112

  
......
112 114
	id->mhs[j] = monCreateMeasure(BYTE, TXONLY | PACKET | IN_BAND);
113 115
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
114 116
	//Uncomment the following line to publish results
115
	monPublishStatisticalType(id->mhs[j], "TxBytesChunk", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
117
	monPublishStatisticalType(id->mhs[j], "TxBytesChunk", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
116 118
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
117 119
	j++;
118 120

  
119 121
	id->mhs[j] = monCreateMeasure(BULK_TRANSFER, RXONLY | PACKET | TIMER_BASED);
120 122
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
121 123
	//Uncomment the following line to publish results
122
	monPublishStatisticalType(id->mhs[j], "RxChunkSec", "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
124
	monPublishStatisticalType(id->mhs[j], "RxChunkSec", channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
123 125
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
124 126
        j++;
125 127

  
126 128
	id->mhs[j] = monCreateMeasure(BULK_TRANSFER, TXONLY | PACKET | TIMER_BASED);
127 129
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
128 130
	//Uncomment the following line to publish results
129
	monPublishStatisticalType(id->mhs[j], "TxChunkSec", "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
131
	monPublishStatisticalType(id->mhs[j], "TxChunkSec", channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
130 132
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
131 133
        j++;
132 134

  
133 135
	id->mhs[j] = monCreateMeasure(BULK_TRANSFER, RXONLY | PACKET | TIMER_BASED);
134 136
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
135 137
	//Uncomment the following line to publish results
136
	monPublishStatisticalType(id->mhs[j], "RxSigSec", "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
138
	monPublishStatisticalType(id->mhs[j], "RxSigSec", channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
137 139
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_SIGNALLING);
138 140
        j++;
139 141

  
140 142
	id->mhs[j] = monCreateMeasure(BULK_TRANSFER, TXONLY | PACKET | TIMER_BASED);
141 143
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
142 144
	//Uncomment the following line to publish results
143
	monPublishStatisticalType(id->mhs[j], "TxSigSec", "OfferStreamer", stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
145
	monPublishStatisticalType(id->mhs[j], "TxSigSec", channel, stavg , sizeof(stavg)/sizeof(enum stat_types), NULL);
144 146
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_SIGNALLING);
145 147
        j++;
146 148

  
147 149
	id->mhs[j] = monCreateMeasure(COUNTER, RXONLY | DATA);
148 150
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
149 151
	//Uncomment the following line to publish results
150
	monPublishStatisticalType(id->mhs[j], "RxChunks", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
152
	monPublishStatisticalType(id->mhs[j], "RxChunks", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
151 153
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
152 154
        j++;
153 155

  
154 156
	id->mhs[j] = monCreateMeasure(COUNTER, TXONLY | DATA);
155 157
	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 600);
156 158
	//Uncomment the following line to publish results
157
	monPublishStatisticalType(id->mhs[j], "TxChunks", "OfferStreamer", stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
159
	monPublishStatisticalType(id->mhs[j], "TxChunks", channel, stsum , sizeof(stsum)/sizeof(enum stat_types), NULL);
158 160
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
159 161
        j++;
160 162

  

Also available in: Unified diff