flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.56k stars 291 forks source link

[Feature Request] Additional frametime metrics #585

Open kkartaltepe opened 3 years ago

kkartaltepe commented 3 years ago

I was looking at frame_timing with mangohud and thought it would be nice to have a couple additional metrics to characterize the graph better.

  1. Benchmark statistics available live (either for the graphing period only or possibly for the full run)
  2. An aggregated histogram (probably for the graphing period only). Im not sure what the intention of the histogram setting is, but it seems its just different way to render the existing frame_timings graph. I expected to see the frame timings aggregated into timing window buckets e.g. something like (pardon the ascii art)
     Frame time (ms) : count     distribution
       0 -> 1        : 3        |                                      |
       2 -> 3        : 0        |                                      |
       4 -> 7        : 211      |**********                            |
       8 -> 15       : 0        |                                      |
      16 -> 31       : 0        |                                      |
      32 -> 63       : 0        |                                      |
      64 -> 127      : 1        |                                      |
     128 -> 255      : 800      |**************************************|

The above example is just an exponentially increasing bucket size, but probably there are more appropriate ones given refresh rates.

One reasonable to me approach for benchmark stats would be to just use a 1002 element histogram to record all frame timings between 1ms and 1000ms, with over/under flow buckets for frames rendering faster than 1000fps or slower than 1fps allowing computation of benchmark percentiles at 1ms resolution and fast computation of a coarser histogram for display. Possibly allowing a hotkey to reset the data if support for the full run is considered useful.

If desired you could also add a few thousand more elements if people are interested in frame timings beyond 1000fps or below 1fps.

My main motivation is to see where frame hitches fall so knowing the 99%ile value would be helpful and its hard to see from the graph and doing it live is easier than going through the logging process. During some other runs where hitches seem multi-modal (some seem to stall for an entire frame while others stall for less time) it would be cool to just edit a histogram to show me (this is probably more cool than useful as compared to the live benchmark stats, at least to me).

floorcat commented 3 years ago

I would like to have min max frame timings similar to mesa overlay: mesa-fs8 :