Revision dfcfa0fe

View differences:

measures.c
25 25
static int played = 0;
26 26
static uint64_t sum_reorder_delay = 0;
27 27

  
28
static int chunks_received = 0;
28
static int chunks_received_dup = 0, chunks_received_nodup = 0, chunks_received_old = 0;
29 29
static int sum_hopcount = 0;
30 30
static uint64_t sum_receive_delay = 0;
31 31

  
......
49 49
{
50 50
  struct timeval tnow;
51 51

  
52
  if (chunks) print_measure("ChunksPlayed", (double)chunks);
53
  if (chunks) print_measure("DuplicateRatio", (double)duplicates / chunks);
54 52
  if (chunks) print_measure("PlayoutRatio", (double)played / chunks);
55
  if (chunks) print_measure("ReorderDelay", (double)sum_reorder_delay / 1e6 / chunks);
53
  if (chunks) print_measure("ReorderDelay(ok&lost)", (double)sum_reorder_delay / 1e6 / chunks);
56 54
  print_measure("NeighSize", (double)neighsize);
57
  if (chunks_received) print_measure("OverlayDistance", (double)sum_hopcount / chunks_received);
58
  if (chunks_received) print_measure("ReceiveDelay", (double)sum_receive_delay / 1e6 / chunks_received);
55
  if (chunks_received_nodup) print_measure("OverlayDistance(intime&nodup)", (double)sum_hopcount / chunks_received_nodup);
56
  if (chunks_received_nodup) print_measure("ReceiveDelay(intime&nodup)", (double)sum_receive_delay / 1e6 / chunks_received_nodup);
59 57

  
60 58
  gettimeofday(&tnow, NULL);
61
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate", (double) chunks_received / tdiff_sec(&tnow, &print_tstart));
59
  if (timerisset(&print_tstart)) print_measure("ChunkRate", (double) chunks / tdiff_sec(&tnow, &print_tstart));
60
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(all)", (double) (chunks_received_old + chunks_received_nodup + chunks_received_dup)  / tdiff_sec(&tnow, &print_tstart));
61
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(old)", (double) chunks_received_old / tdiff_sec(&tnow, &print_tstart));
62
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&nodup)", (double) chunks_received_nodup / tdiff_sec(&tnow, &print_tstart));
63
  if (timerisset(&print_tstart)) print_measure("ChunkReceiveRate(intime&dup)", (double) chunks_received_dup / tdiff_sec(&tnow, &print_tstart));
62 64
  if (timerisset(&print_tstart)) print_measure("ChunkSendRate", (double) chunks_sent / tdiff_sec(&tnow, &print_tstart));
65

  
66
  if (chunks_received_old + chunks_received_nodup + chunks_received_dup) print_measure("ReceiveRatio(intime&nodup-vs-all)", (double)chunks_received_nodup / (chunks_received_old + chunks_received_nodup + chunks_received_dup));
63 67
}
64 68

  
65 69
bool print_every()
......
134 138

  
135 139
  if (!print_every()) return;
136 140

  
137
  chunks_received++;
138
  sum_hopcount += hopcount;
139
  gettimeofday(&tnow, NULL);
140
  sum_receive_delay += (tnow.tv_usec + tnow.tv_sec * 1000000ULL) - timestamp;
141
  if (old) {
142
    chunks_received_old++;
143
  } else {
144
    if (dup) { //duplicate detection works only for in-time arrival
145
      chunks_received_dup++;
146
    } else {
147
      chunks_received_nodup++;
148
      sum_hopcount += hopcount;
149
      gettimeofday(&tnow, NULL);
150
      sum_receive_delay += (tnow.tv_usec + tnow.tv_sec * 1000000ULL) - timestamp;
151
    }
152
  }
141 153
}
142 154

  
143 155
/*

Also available in: Unified diff