Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a debug message, which appears when event loop processing in Mixxx application takes very long #12094

Merged
merged 10 commits into from
Nov 4, 2024
Merged
20 changes: 19 additions & 1 deletion src/mixxxapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class QMouseEventEditable : public QMouseEvent {
#endif
};

constexpr mixxx::Duration kEventNotifyExecTimeWarningThreshold = mixxx::Duration::fromMillis(20);
JoergAtGithub marked this conversation as resolved.
Show resolved Hide resolved

} // anonymous namespace
#endif

Expand Down Expand Up @@ -168,7 +170,23 @@ bool MixxxApplication::notify(QObject* target, QEvent* event) {
default:
break;
}
return QApplication::notify(target, event);

PerformanceTimer time;
time.start();

bool ret = QApplication::notify(target, event);

if (time.elapsed() > kEventNotifyExecTimeWarningThreshold) {
qDebug() << "Processing event type"
JoergAtGithub marked this conversation as resolved.
Show resolved Hide resolved
<< event->type()
<< "for object"
<< target->metaObject()->className()
<< target->objectName()
<< "took"
<< time.elapsed().debugMillisWithUnit();
}

return ret;
}

bool MixxxApplication::touchIsRightButton() {
Expand Down
Loading