Statistics
| Branch: | Revision:

streamers / measures.c @ 7f591208

History | View | Annotate | Download (1.41 KB)

1
/*
2
 *  Copyright (c) 2010 Csaba Kiraly
3
 *
4
 *  This is free software; see gpl-3.0.txt
5
 */
6
#include <stdint.h>
7
#include <math.h>
8
#ifndef NAN        //NAN is missing in some old math.h versions
9
#define NAN            (0.0/0.0)
10
#endif
11
#ifndef INFINITY
12
#define INFINITY       (1.0/0.0)
13
#endif
14

    
15
#include "measures.h"
16

    
17
/*
18
 * Register duplicate arrival
19
*/
20
void reg_chunk_duplicate()
21
{
22
  static int duplicates = 0;
23

    
24
  duplicates++;
25
}
26

    
27
/*
28
 * Register playout/loss of a chunk before playout
29
*/
30
void reg_chunk_playout(int id, bool b, uint64_t timestamp)
31
{
32
  static int chunks = 0;
33
  static int sum = 0;
34

    
35
  sum += b ? 1 : 0;
36
  chunks++;
37
}
38

    
39
/*
40
 * Register actual neghbourhood size
41
*/
42
void reg_neigh_size(int s)
43
{
44
}
45

    
46
/*
47
 * Register chunk receive event
48
*/
49
void reg_chunk_receive(int id, uint64_t timestamp, int hopcount)
50
{
51
  static int chunks_received = 0;
52
  static int sum_hopcount = 0;
53

    
54
  chunks_received++;
55
  sum_hopcount += hopcount;
56
}
57

    
58
/*
59
 * Register chunk send event
60
*/
61
void reg_chunk_send(int id)
62
{
63
  static int chunks_sent = 0;
64

    
65
  chunks_sent++;
66
}
67

    
68
/*
69
 * Register chunk accept evemt
70
*/
71
void reg_offer_accept(bool b)
72
{
73
  static int offers = 0;
74
  static int accepts = 0;
75

    
76
  offers++;
77
  if (b) accepts++;
78
}
79

    
80
/*
81
 * Initialize peer level measurements
82
*/
83
void init_measures()
84
{
85
}
86

    
87
/*
88
 * Initialize p2p measurements towards a peer
89
*/
90
void add_measures(struct nodeID *id)
91
{
92
}
93

    
94
/*
95
 * Delete p2p measurements towards a peer
96
*/
97
void delete_measures(struct nodeID *id)
98
{
99
}