mirror of
https://github.com/Telecominfraproject/wlan-cloud-owls.git
synced 2026-01-17 18:51:05 +00:00
Fixing stats reset at sim startup.
This commit is contained in:
@@ -41,6 +41,17 @@ namespace OpenWifi {
|
||||
Poco::Thread::trySleep(2000);
|
||||
if(!Running_)
|
||||
break;
|
||||
|
||||
if(SimStats()->GetState()!="running") {
|
||||
continue;
|
||||
}
|
||||
|
||||
uint64_t Now = std::time(nullptr);
|
||||
|
||||
if( (Now - SimStats()->GetStartTime()) > CurrentSim_.simulationLength ) {
|
||||
std::string Error;
|
||||
StopSim( SimStats()->Id(), Error );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,6 +153,12 @@ namespace OpenWifi {
|
||||
|
||||
SimRunning_ = false;
|
||||
SimStats()->SetState("stopped");
|
||||
SimStats()->EndSim();
|
||||
|
||||
OWLSObjects::SimulationStatus S;
|
||||
SimStats()->GetCurrent(S);
|
||||
StorageService()->SimulationResultsDB().CreateRecord(S);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user