Made statistics and userpages independant of each other.

This commit is contained in:
Thulinma 2014-06-20 11:05:04 +02:00
parent 80b905965e
commit 1206b76b4a

View file

@ -626,26 +626,25 @@ namespace Mist {
}
void Output::stats(){
if (!statsPage.getData()){
return;
}
unsigned long long int now = Util::epoch();
if (now != lastStats){
lastStats = now;
IPC::statExchange tmpEx(statsPage.getData());
tmpEx.now(now);
tmpEx.host(myConn.getHost());
tmpEx.streamName(streamName);
tmpEx.connector(capa["name"].asString());
tmpEx.up(myConn.dataUp());
tmpEx.down(myConn.dataDown());
tmpEx.time(now - myConn.connTime());
if (currentPacket){
tmpEx.lastSecond(currentPacket.getTime());
}else{
tmpEx.lastSecond(0);
if (statsPage.getData()){
unsigned long long int now = Util::epoch();
if (now != lastStats){
lastStats = now;
IPC::statExchange tmpEx(statsPage.getData());
tmpEx.now(now);
tmpEx.host(myConn.getHost());
tmpEx.streamName(streamName);
tmpEx.connector(capa["name"].asString());
tmpEx.up(myConn.dataUp());
tmpEx.down(myConn.dataDown());
tmpEx.time(now - myConn.connTime());
if (currentPacket){
tmpEx.lastSecond(currentPacket.getTime());
}else{
tmpEx.lastSecond(0);
}
statsPage.keepAlive();
}
statsPage.keepAlive();
}
int tNum = 0;
if (!playerConn.getData()){