mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Monitorize folder content controller performance in debug mode.
This commit is contained in:
parent
630a5c94a0
commit
87b0e64b1a
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include "qnaturalsorting.h"
|
#include "qnaturalsorting.h"
|
||||||
|
|
||||||
|
#include "QsLog.h"
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -40,6 +42,9 @@ void FolderContentControllerV2::service(HttpRequest& request, HttpResponse& resp
|
|||||||
|
|
||||||
void FolderContentControllerV2::serviceContent(const int &library, const qulonglong &folderId, HttpResponse &response)
|
void FolderContentControllerV2::serviceContent(const int &library, const qulonglong &folderId, HttpResponse &response)
|
||||||
{
|
{
|
||||||
|
#ifdef QT_DEBUG
|
||||||
|
auto started = std::chrono::high_resolution_clock::now();
|
||||||
|
#endif
|
||||||
QList<LibraryItem *> folderContent = DBHelper::getFolderSubfoldersFromLibrary(library,folderId);
|
QList<LibraryItem *> folderContent = DBHelper::getFolderSubfoldersFromLibrary(library,folderId);
|
||||||
QList<LibraryItem *> folderComics = DBHelper::getFolderComicsFromLibrary(library,folderId);
|
QList<LibraryItem *> folderComics = DBHelper::getFolderComicsFromLibrary(library,folderId);
|
||||||
|
|
||||||
@ -69,4 +74,10 @@ void FolderContentControllerV2::serviceContent(const int &library, const qulongl
|
|||||||
QJsonDocument output(items);
|
QJsonDocument output(items);
|
||||||
|
|
||||||
response.write(output.toJson());
|
response.write(output.toJson());
|
||||||
|
#ifdef QT_DEBUG
|
||||||
|
auto done = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
|
QLOG_TRACE() << "num items = " << items.count();
|
||||||
|
QLOG_TRACE() << std::chrono::duration_cast<std::chrono::milliseconds>(done-started).count();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user