Revision 3bb247c8 measures.c

View differences:

measures.c
76 76
void print_measures()
77 77
{
78 78
  struct timeval tnow;
79
  double timespan;
80

  
81
  gettimeofday(&tnow, NULL);
82
  timespan = tdiff_sec(&tnow, &print_tstart);
79 83

  
80 84
  if (m.chunks) print_measure("PlayoutRatio", (double)m.played / m.chunks);
81 85
  if (m.chunks) print_measure("ReorderDelay(ok&lost)", (double)m.sum_reorder_delay / 1e6 / m.chunks);
......
83 87
  if (m.chunks_received_nodup) print_measure("OverlayDistance(intime&nodup)", (double)m.sum_hopcount / m.chunks_received_nodup);
84 88
  if (m.chunks_received_nodup) print_measure("ReceiveDelay(intime&nodup)", (double)m.sum_receive_delay / 1e6 / m.chunks_received_nodup);
85 89

  
86
  gettimeofday(&tnow, NULL);
87
  if (timerisset(&print_tstart)) print_measure("ChunkRate", (double) m.chunks / tdiff_sec(&tnow, &print_tstart));
88
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(all)", (double) (m.chunks_received_old + m.chunks_received_nodup + m.chunks_received_dup)  / tdiff_sec(&tnow, &print_tstart));
89
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(old)", (double) m.chunks_received_old / tdiff_sec(&tnow, &print_tstart));
90
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&nodup)", (double) m.chunks_received_nodup / tdiff_sec(&tnow, &print_tstart));
91
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&dup)", (double) m.chunks_received_dup / tdiff_sec(&tnow, &print_tstart));
92
  if (timerisset(&print_tstart)) print_measure("ChunkSendRate", (double) m.chunks_sent / tdiff_sec(&tnow, &print_tstart));
90
  if (timerisset(&print_tstart)) print_measure("ChunkRate", (double) m.chunks / timespan);
91
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(all)", (double) (m.chunks_received_old + m.chunks_received_nodup + m.chunks_received_dup)  / timespan);
92
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(old)", (double) m.chunks_received_old / timespan);
93
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&nodup)", (double) m.chunks_received_nodup / timespan);
94
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&dup)", (double) m.chunks_received_dup / timespan);
95
  if (timerisset(&print_tstart)) print_measure("ChunkSendRate", (double) m.chunks_sent / timespan);
93 96

  
94 97
  if (timerisset(&print_tstart)) {
95
    print_measure("SendRateMsgs(all)", (double) m.msgs_sent / tdiff_sec(&tnow, &print_tstart));
96
    print_measure("SendRateMsgs(chunk)", (double) m.msgs_sent_chunk / tdiff_sec(&tnow, &print_tstart));
97
    print_measure("SendRateMsgs(sign)", (double) m.msgs_sent_sign / tdiff_sec(&tnow, &print_tstart));
98
    print_measure("SendRateMsgs(topo)", (double) m.msgs_sent_topo / tdiff_sec(&tnow, &print_tstart));
99
    print_measure("SendRateMsgs(other)", (double) (m.msgs_sent - m.msgs_sent_chunk - m.msgs_sent_sign - m.msgs_sent_topo) / tdiff_sec(&tnow, &print_tstart));
100

  
101
    print_measure("SendRateBytes(all)", (double) m.bytes_sent / tdiff_sec(&tnow, &print_tstart));
102
    print_measure("SendRateBytes(chunk)", (double) m.bytes_sent_chunk / tdiff_sec(&tnow, &print_tstart));
103
    print_measure("SendRateBytes(sign)", (double) m.bytes_sent_sign / tdiff_sec(&tnow, &print_tstart));
104
    print_measure("SendRateBytes(topo)", (double) m.bytes_sent_topo / tdiff_sec(&tnow, &print_tstart));
105
    print_measure("SendRateBytes(other)", (double) (m.bytes_sent - m.bytes_sent_chunk - m.bytes_sent_sign - m.bytes_sent_topo) / tdiff_sec(&tnow, &print_tstart));
106

  
107
    print_measure("RecvRateMsgs(all)", (double) m.msgs_recvd / tdiff_sec(&tnow, &print_tstart));
108
    print_measure("RecvRateMsgs(chunk)", (double) m.msgs_recvd_chunk / tdiff_sec(&tnow, &print_tstart));
109
    print_measure("RecvRateMsgs(sign)", (double) m.msgs_recvd_sign / tdiff_sec(&tnow, &print_tstart));
110
    print_measure("RecvRateMsgs(topo)", (double) m.msgs_recvd_topo / tdiff_sec(&tnow, &print_tstart));
111
    print_measure("RecvRateMsgs(other)", (double) (m.msgs_recvd - m.msgs_recvd_chunk - m.msgs_recvd_sign - m.msgs_recvd_topo) / tdiff_sec(&tnow, &print_tstart));
112

  
113
    print_measure("RecvRateBytes(all)", (double) m.bytes_recvd / tdiff_sec(&tnow, &print_tstart));
114
    print_measure("RecvRateBytes(chunk)", (double) m.bytes_recvd_chunk / tdiff_sec(&tnow, &print_tstart));
115
    print_measure("RecvRateBytes(sign)", (double) m.bytes_recvd_sign / tdiff_sec(&tnow, &print_tstart));
116
    print_measure("RecvRateBytes(topo)", (double) m.bytes_recvd_topo / tdiff_sec(&tnow, &print_tstart));
117
    print_measure("RecvRateBytes(other)", (double) (m.bytes_recvd - m.bytes_recvd_chunk - m.bytes_recvd_sign - m.bytes_recvd_topo) / tdiff_sec(&tnow, &print_tstart));
98
    print_measure("SendRateMsgs(all)", (double) m.msgs_sent / timespan);
99
    print_measure("SendRateMsgs(chunk)", (double) m.msgs_sent_chunk / timespan);
100
    print_measure("SendRateMsgs(sign)", (double) m.msgs_sent_sign / timespan);
101
    print_measure("SendRateMsgs(topo)", (double) m.msgs_sent_topo / timespan);
102
    print_measure("SendRateMsgs(other)", (double) (m.msgs_sent - m.msgs_sent_chunk - m.msgs_sent_sign - m.msgs_sent_topo) / timespan);
103

  
104
    print_measure("SendRateBytes(all)", (double) m.bytes_sent / timespan);
105
    print_measure("SendRateBytes(chunk)", (double) m.bytes_sent_chunk / timespan);
106
    print_measure("SendRateBytes(sign)", (double) m.bytes_sent_sign / timespan);
107
    print_measure("SendRateBytes(topo)", (double) m.bytes_sent_topo / timespan);
108
    print_measure("SendRateBytes(other)", (double) (m.bytes_sent - m.bytes_sent_chunk - m.bytes_sent_sign - m.bytes_sent_topo) / timespan);
109

  
110
    print_measure("RecvRateMsgs(all)", (double) m.msgs_recvd / timespan);
111
    print_measure("RecvRateMsgs(chunk)", (double) m.msgs_recvd_chunk / timespan);
112
    print_measure("RecvRateMsgs(sign)", (double) m.msgs_recvd_sign / timespan);
113
    print_measure("RecvRateMsgs(topo)", (double) m.msgs_recvd_topo / timespan);
114
    print_measure("RecvRateMsgs(other)", (double) (m.msgs_recvd - m.msgs_recvd_chunk - m.msgs_recvd_sign - m.msgs_recvd_topo) / timespan);
115

  
116
    print_measure("RecvRateBytes(all)", (double) m.bytes_recvd / timespan);
117
    print_measure("RecvRateBytes(chunk)", (double) m.bytes_recvd_chunk / timespan);
118
    print_measure("RecvRateBytes(sign)", (double) m.bytes_recvd_sign / timespan);
119
    print_measure("RecvRateBytes(topo)", (double) m.bytes_recvd_topo / timespan);
120
    print_measure("RecvRateBytes(other)", (double) (m.bytes_recvd - m.bytes_recvd_chunk - m.bytes_recvd_sign - m.bytes_recvd_topo) / timespan);
118 121
  }
119 122

  
120 123
  if (m.chunks_received_old + m.chunks_received_nodup + m.chunks_received_dup) print_measure("ReceiveRatio(intime&nodup-vs-all)", (double)m.chunks_received_nodup / (m.chunks_received_old + m.chunks_received_nodup + m.chunks_received_dup));
......
123 126
  if (m.samples_queue_delay) print_measure("QueueDelay", m.sum_queue_delay / m.samples_queue_delay);
124 127

  
125 128
  if (timerisset(&print_tstart)) {
126
    print_measure("OfferRate", (double) m.offers / tdiff_sec(&tnow, &print_tstart));
127
    print_measure("AcceptRate", (double) m.accepts / tdiff_sec(&tnow, &print_tstart));
129
    print_measure("OfferRate", (double) m.offers / timespan);
130
    print_measure("AcceptRate", (double) m.accepts / timespan);
128 131
  }
129 132
  if (m.offers) print_measure("OfferAcceptRatio", (double)m.accepts / m.offers);
130 133
}

Also available in: Unified diff