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 basic global statistics for input handler events #6087

Merged
merged 6 commits into from
Dec 26, 2023

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Dec 24, 2023

Adds basic statistics to InputHandlers counting the total number of handled events.

This can aid when debugging input:

  • check which handler the event came from
  • quickly check if a single user input is being handled by multiple handlers (if multiple handlers' event counts increase from a single user action, it's probably a bug)
  • if a need arises when debugging, the statistics can be made more specific (as was done in 3f4f735)

While most handlers have only basic Total events statistics, WindowsMouseHandler and AndroidTouchHandler have additional, specific statistics. I thought those were useful, so I included them.

Example of displayed global statistics:

(note that a handler is not shown until its statistic is increased, this helps reduce noise. eg. TouchHandler is not shown here)

image

The existing *Events under Input are not that useful for the purposes described above – those only count the number of events in a single input frame (at 1000 Hz) and are more suited to debugging lag from long event queues.

@smoogipoo smoogipoo enabled auto-merge December 26, 2023 01:55
@smoogipoo smoogipoo merged commit a86dfaa into ppy:master Dec 26, 2023
13 checks passed
@Susko3 Susko3 deleted the better-input-handler-statistics branch December 26, 2023 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants