Skip to content

Keep track of FPS throughput at different key moments.#36

Merged
henryouly merged 2 commits intomainfrom
henryouly-fps-logging
Jun 11, 2022
Merged

Keep track of FPS throughput at different key moments.#36
henryouly merged 2 commits intomainfrom
henryouly-fps-logging

Conversation

@henryouly
Copy link
Collaborator

@henryouly henryouly commented Jun 11, 2022

Adds SystemStats class to keep track of four key frame rates:

  • The frame rate to read from camera output texture into internal CPU buffer
  • The frame rate to send frames to mediapipe graph
  • The frame rate when the holistic model returns results (async callbacks)
  • The frame rate when the Update() method kicks in and push the result to UnityEvents

Usage:
After starting the scene, there will be 3 seconds delay to start getting FPS data
After ending the scene, last 20 frames will be printed to debug console, like:

SystemStats: [0] FrameReadTexture: 24 FrameAddToInputStream: 24 FrameProcessed: 24 FrameRendered: 24
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [1] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [2] FrameReadTexture: 24 FrameAddToInputStream: 24 FrameProcessed: 24 FrameRendered: 24
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [3] FrameReadTexture: 26 FrameAddToInputStream: 26 FrameProcessed: 26 FrameRendered: 26
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [4] FrameReadTexture: 24 FrameAddToInputStream: 24 FrameProcessed: 24 FrameRendered: 24
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [5] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [6] FrameReadTexture: 24 FrameAddToInputStream: 24 FrameProcessed: 24 FrameRendered: 24
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [7] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [8] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [9] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [10] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [11] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 26 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [12] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

SystemStats: [13] FrameReadTexture: 25 FrameAddToInputStream: 25 FrameProcessed: 25 FrameRendered: 25
UnityEngine.Debug:Log (object)
SeedUnityVRKit.SystemStats:OnApplicationQuit () (at Assets/Scripts/Tracker/SystemStats.cs:69)

@henryouly henryouly requested review from superkudo and wixette June 11, 2022 00:43
@henryouly henryouly force-pushed the henryouly-fps-logging branch from ab00aa9 to 728e7cd Compare June 11, 2022 00:58
Copy link
Contributor

@wixette wixette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@henryouly henryouly merged commit ec5bfd9 into main Jun 11, 2022
@henryouly henryouly deleted the henryouly-fps-logging branch June 11, 2022 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants