7 #include "application.h" 9 #include "dispatchtype.h" 14 #include <QtCore/QStringList> 20 : d_ptr(new StatsPrivate)
23 d->engineRequest = request;
31 void Stats::profileStart(
const QString &action)
36 stat.
begin = std::chrono::steady_clock::now();
37 d->actions.push_back(stat);
40 void Stats::profileEnd(
const QString &action)
43 auto it = std::ranges::find_if(d->actions,
44 [action](
const auto &stat) { return stat.action == action; });
46 if (it != d->actions.end()) {
47 it->end = std::chrono::steady_clock::now();
56 if (d->actions.empty()) {
61 for (
const auto &stat : d->actions) {
62 const std::chrono::duration<double> duration =
63 (stat.end.has_value() ? stat.end.value() : std::chrono::steady_clock::now()) -
65 table.
append({stat.action, QString::number(duration.count(),
'f') + u
's'});
68 ret = Utils::buildTable(table,
The Cutelyst namespace holds all public Cutelyst API.
void append(QList< T > &&value)