Revision 7405358f

View differences:

measures.c
22 22

  
23 23
	dprintf("adding measures to %s\n",node_addr(id));
24 24
	// RX bytes
25
//	id->mhs[j] = monCreateMeasure(BYTE, RXONLY | PACKET | IN_BAND);
25
	id->mhs[j] = monCreateMeasure(BYTE, RXONLY | PACKET | IN_BAND);
26 26
//	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 100);
27 27
	//Uncomment the following line to publish results
28
	//monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
29
//	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
30
//	j++;
28
	monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
29
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
30
	j++;
31 31
	// TX bytes
32
//	id->mhs[j] = monCreateMeasure(BYTE, TXONLY | PACKET | IN_BAND);
32
	id->mhs[j] = monCreateMeasure(BYTE, TXONLY | PACKET | IN_BAND);
33 33
//	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 100);
34 34
	//Uncomment the following line to publish results
35
	//monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
36
//	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
37
//	j++;
35
	monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
36
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
37
	j++;
38 38
	/* HopCount */
39
//	id->mhs[j] = monCreateMeasure(HOPCOUNT, TXRXUNI | PACKET | IN_BAND);
39
	id->mhs[j] = monCreateMeasure(HOPCOUNT, TXRXUNI | PACKET | IN_BAND);
40 40
//	monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 100);
41 41
	//Uncomment the following line to publish results
42
	//monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
43
//	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
44
//	j++;
42
	monPublishStatisticalType(id->mhs[j], NULL, st , sizeof(st)/sizeof(enum stat_types), NULL);
43
	monActivateMeasure(id->mhs[j], id->addr, MSG_TYPE_CHUNK);
44
	j++;
45 45
	/* Round Trip Time */
46 46
	id->mhs[j] = monCreateMeasure(RTT, TXRXBI | PACKET | IN_BAND);
47 47
	//monSetParameter (id->mhs[j], P_PUBLISHING_RATE, 100);
......
77 77

  
78 78
//in seconds
79 79
double get_rtt(struct nodeID *id){
80
	return get_measure(id, 0, WIN_AVG);
80
	return get_measure(id, 3, WIN_AVG);
81 81
}
82 82

  
83 83
double get_lossrate(struct nodeID *id){
84
	return get_measure(id, 1, WIN_AVG);
84
	return get_measure(id, 4, WIN_AVG);
85 85
}

Also available in: Unified diff