1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Calculate maximum used buffer size and show it in statistics.

This commit is contained in:
Antti Seppälä 2007-10-11 19:44:46 +00:00
parent eba2e3ba43
commit c220b5e692

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * See the README file for copyright information and how to reach the author.
* *
* $Id: statistics.c,v 1.18 2007/10/10 20:08:25 rahrenbe Exp $ * $Id: statistics.c,v 1.19 2007/10/11 19:44:46 ajhseppa Exp $
*/ */
#include <limits.h> #include <limits.h>
@ -197,6 +197,8 @@ cString cIptvBufferStatistics::GetStatistic()
IptvConfig.GetUseBytes() ? "B" : "bit", usedKilos, usedKilos + freeKilos, IptvConfig.GetUseBytes() ? "B" : "bit", usedKilos, usedKilos + freeKilos,
IptvConfig.GetUseBytes() ? "B" : "bit", percentage); IptvConfig.GetUseBytes() ? "B" : "bit", percentage);
dataBytes = 0; dataBytes = 0;
freeSpace = 0;
usedSpace = 0;
return info; return info;
} }
@ -205,6 +207,8 @@ void cIptvBufferStatistics::AddStatistic(long Bytes, long Used, long Free)
//debug("cIptvBufferStatistics::AddStatistic(Bytes=%ld, Used=%ld, Free=%ld)\n", Bytes, Used, Free); //debug("cIptvBufferStatistics::AddStatistic(Bytes=%ld, Used=%ld, Free=%ld)\n", Bytes, Used, Free);
cMutexLock MutexLock(&mutex); cMutexLock MutexLock(&mutex);
dataBytes += Bytes; dataBytes += Bytes;
if (Used > usedSpace) {
freeSpace = Free; freeSpace = Free;
usedSpace = Used; usedSpace = Used;
}
} }