mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactoring of webui and event based websocket layer (#219)
* make hyperion websocket api event based * implement new websocket handling for generalconf * migrate all webui stuff to new event based websocket api some cleanup ... now all html templates are in content refactoring of web stuff * add hyperionport to global start impl. removing advanced key * separate dashboard serverinfo is updated every 3 seconds automatily add input selection cleanup and remove not needed stuff * prepare infrastructure for server sided file execution * webui minor fixes * fix compile
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "HyperionConfig.h"
|
||||
#include "utils/Profiler.h"
|
||||
#include <utils/Profiler.h>
|
||||
#include <utils/FileUtils.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QString>
|
||||
@@ -15,21 +16,11 @@ static unsigned int blockCounter = 0;
|
||||
static std::map<std::string,StopWatchItem> GlobalProfilerMap;
|
||||
Logger* Profiler::_logger = nullptr;
|
||||
|
||||
|
||||
|
||||
std::string profiler_getBaseName( std::string sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile.c_str() );
|
||||
return fi.fileName().toStdString();
|
||||
}
|
||||
|
||||
double getClockDelta(clock_t start)
|
||||
{
|
||||
return ((double)(clock() - start) / CLOCKS_PER_SEC) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Profiler::Profiler(const char* sourceFile, const char* func, unsigned int line) :
|
||||
_file(sourceFile),
|
||||
_func(func),
|
||||
@@ -71,7 +62,7 @@ void Profiler::TimerStart(const std::string timerName, const char* sourceFile, c
|
||||
else
|
||||
{
|
||||
_logger->Message(Logger::DEBUG, sourceFile, func, line, "ERROR timer '%s' started in multiple locations. First occurence %s:%d:%s()",
|
||||
timerName.c_str(), profiler_getBaseName(ret.first->second.sourceFile).c_str(), ret.first->second.line, ret.first->second.func );
|
||||
timerName.c_str(), FileUtils::getBaseName(ret.first->second.sourceFile).c_str(), ret.first->second.line, ret.first->second.func );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -88,7 +79,7 @@ void Profiler::TimerGetTime(const std::string timerName, const char* sourceFile,
|
||||
if (ret != GlobalProfilerMap.end())
|
||||
{
|
||||
_logger->Message(Logger::DEBUG, sourceFile, func, line, "timer '%s' started at %s:%d:%s() took %f s execution time until here", timerName.c_str(),
|
||||
profiler_getBaseName(ret->second.sourceFile).c_str(), ret->second.line, ret->second.func, getClockDelta(ret->second.startTime) );
|
||||
FileUtils::getBaseName(ret->second.sourceFile).c_str(), ret->second.line, ret->second.func, getClockDelta(ret->second.startTime) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user