File: statistics.h

package info (click to toggle)
vdr-plugin-satip 2.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 500 kB
  • sloc: ansic: 6,308; makefile: 93; python: 67
file content (87 lines) | stat: -rw-r--r-- 1,632 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * statistics.h: SAT>IP plugin for the Video Disk Recorder
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef __SATIP_STATISTICS_H
#define __SATIP_STATISTICS_H

#include <vdr/thread.h>

// Section statistics
class cSatipSectionStatistics {
public:
  cSatipSectionStatistics();
  virtual ~cSatipSectionStatistics();
  cString GetSectionStatistic();

protected:
  void AddSectionStatistic(long bytesP, long callsP);

private:
  long filteredDataM;
  long numberOfCallsM;
  cTimeMs timerM;
  cMutex mutexM;
};

// Pid statistics
class cSatipPidStatistics {
public:
  cSatipPidStatistics();
  virtual ~cSatipPidStatistics();
  cString GetPidStatistic();

protected:
  void AddPidStatistic(int pidP, long payloadP);

private:
  struct pidStruct {
    int  pid;
    long dataAmount;
  };
  pidStruct mostActivePidsM[SATIP_STATS_ACTIVE_PIDS_COUNT];
  cTimeMs timerM;
  cMutex mutexM;

private:
  static int SortPids(const void* data1P, const void* data2P);
};

// Tuner statistics
class cSatipTunerStatistics {
public:
  cSatipTunerStatistics();
  virtual ~cSatipTunerStatistics();
  cString GetTunerStatistic();

protected:
  void AddTunerStatistic(long bytesP);

private:
  long dataBytesM;
  cTimeMs timerM;
  cMutex mutexM;
};

// Buffer statistics
class cSatipBufferStatistics {
public:
  cSatipBufferStatistics();
  virtual ~cSatipBufferStatistics();
  cString GetBufferStatistic();

protected:
  void AddBufferStatistic(long bytesP, long usedP);

private:
  long dataBytesM;
  long freeSpaceM;
  long usedSpaceM;
  cTimeMs timerM;
  cMutex mutexM;
};

#endif // __SATIP_STATISTICS_H