2007-10-05 21:00:44 +02:00
|
|
|
/*
|
|
|
|
* statistics.h: IPTV plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __IPTV_STATISTICS_H
|
|
|
|
#define __IPTV_STATISTICS_H
|
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
#include <vdr/thread.h>
|
|
|
|
|
2007-10-05 21:00:44 +02:00
|
|
|
// Section statistics
|
2008-01-19 22:08:02 +01:00
|
|
|
class cIptvSectionStatistics {
|
2007-10-05 21:00:44 +02:00
|
|
|
public:
|
|
|
|
cIptvSectionStatistics();
|
|
|
|
virtual ~cIptvSectionStatistics();
|
2008-01-19 22:08:02 +01:00
|
|
|
cString GetSectionStatistic();
|
2007-10-07 21:06:33 +02:00
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
protected:
|
2013-02-23 14:31:11 +01:00
|
|
|
void AddSectionStatistic(long bytesP, long callsP);
|
2007-10-08 18:24:48 +02:00
|
|
|
|
2007-10-07 21:06:33 +02:00
|
|
|
private:
|
2013-02-23 14:31:11 +01:00
|
|
|
long filteredDataM;
|
|
|
|
long numberOfCallsM;
|
|
|
|
cTimeMs timerM;
|
|
|
|
cMutex mutexM;
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
2007-10-10 00:12:17 +02:00
|
|
|
// Pid statistics
|
2008-01-19 22:08:02 +01:00
|
|
|
class cIptvPidStatistics {
|
2007-10-05 21:00:44 +02:00
|
|
|
public:
|
2007-10-10 00:12:17 +02:00
|
|
|
cIptvPidStatistics();
|
|
|
|
virtual ~cIptvPidStatistics();
|
2008-01-19 22:08:02 +01:00
|
|
|
cString GetPidStatistic();
|
2007-10-05 21:00:44 +02:00
|
|
|
|
|
|
|
protected:
|
2014-02-19 20:38:11 +01:00
|
|
|
void AddPidStatistic(int pidP, long payloadP);
|
2007-10-05 21:00:44 +02:00
|
|
|
|
|
|
|
private:
|
2007-10-08 14:25:30 +02:00
|
|
|
struct pidStruct {
|
2014-02-19 20:38:11 +01:00
|
|
|
int pid;
|
|
|
|
long dataAmount;
|
2007-10-08 14:25:30 +02:00
|
|
|
};
|
2013-02-23 14:31:11 +01:00
|
|
|
pidStruct mostActivePidsM[IPTV_STATS_ACTIVE_PIDS_COUNT];
|
|
|
|
cTimeMs timerM;
|
|
|
|
cMutex mutexM;
|
2007-10-08 14:25:30 +02:00
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
private:
|
2013-02-23 14:31:11 +01:00
|
|
|
static int SortPids(const void* data1P, const void* data2P);
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Streamer statistics
|
2008-01-19 22:08:02 +01:00
|
|
|
class cIptvStreamerStatistics {
|
2007-10-05 21:00:44 +02:00
|
|
|
public:
|
|
|
|
cIptvStreamerStatistics();
|
|
|
|
virtual ~cIptvStreamerStatistics();
|
2008-01-19 22:08:02 +01:00
|
|
|
cString GetStreamerStatistic();
|
2007-10-07 21:06:33 +02:00
|
|
|
|
2007-10-08 18:24:48 +02:00
|
|
|
protected:
|
2013-02-23 14:31:11 +01:00
|
|
|
void AddStreamerStatistic(long bytesP);
|
2007-10-08 18:24:48 +02:00
|
|
|
|
2007-10-07 21:06:33 +02:00
|
|
|
private:
|
2013-02-23 14:31:11 +01:00
|
|
|
long dataBytesM;
|
|
|
|
cTimeMs timerM;
|
|
|
|
cMutex mutexM;
|
2007-10-05 21:00:44 +02:00
|
|
|
};
|
|
|
|
|
2007-10-09 19:58:17 +02:00
|
|
|
// Buffer statistics
|
2008-01-19 22:08:02 +01:00
|
|
|
class cIptvBufferStatistics {
|
2007-10-09 19:58:17 +02:00
|
|
|
public:
|
|
|
|
cIptvBufferStatistics();
|
|
|
|
virtual ~cIptvBufferStatistics();
|
2008-01-19 22:08:02 +01:00
|
|
|
cString GetBufferStatistic();
|
2007-10-09 19:58:17 +02:00
|
|
|
|
|
|
|
protected:
|
2013-02-23 14:31:11 +01:00
|
|
|
void AddBufferStatistic(long bytesP, long usedP);
|
2007-10-09 19:58:17 +02:00
|
|
|
|
|
|
|
private:
|
2013-02-23 14:31:11 +01:00
|
|
|
long dataBytesM;
|
|
|
|
long freeSpaceM;
|
|
|
|
long usedSpaceM;
|
|
|
|
cTimeMs timerM;
|
|
|
|
cMutex mutexM;
|
2007-10-09 19:58:17 +02:00
|
|
|
};
|
|
|
|
|
2007-10-05 21:00:44 +02:00
|
|
|
#endif // __IPTV_STATISTICS_H
|