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
Metrics-tracking Deck property #3139
Conversation
docs/api-reference/deck.md
Outdated
|
||
#### metrics | ||
|
||
A map of various performance statistics for the last 60 frames of rendering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the names of stats, and what each field means?
docs/api-reference/deck.md
Outdated
- 'Redraw Layers': number of layers drawn | ||
- 'setProps Time': time spent setting properties | ||
- 'Redraw Count': number of times the scene was rendered | ||
- 'pickObject Time': time spent picking an object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the stat is called pickObject Time
, the value should be a single number that is the time. If the value is an object, the stat should just be called pickObject
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stat names are just from grepping where stats are currently used. I agree that it's confusing, but I can't break the current API for this update.
@Pessimistress this actually worked out pretty well. Decided to pull some stats in from luma as well. |
docs/api-reference/deck.md
Outdated
- 'fps': average number of frames rendered per second | ||
- 'updateAttributesTime': time spent updating layer attributes | ||
- 'layersRedrawn': number of layers drawn | ||
- 'setPropsTime': time spent setting layer properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tracks the time spent in deck.setProps
so it should be "deck properties"?
modules/core/src/lib/deck.js
Outdated
/* eslint-disable complexity */ | ||
_getMetrics() { | ||
this.metrics.fps = this.stats.get('frameRate') ? this.stats.get('frameRate').getHz() : 0; | ||
this.metrics.setPropsTime = this.stats.get('setProps Time') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think stats.get
always returns a Stat
instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely correct. Forgot how my own API works :p
docs/api-reference/deck.md
Outdated
- 'updateAttributesTime': time spent updating layer attributes | ||
- 'layersRedrawn': number of layers drawn | ||
- 'setPropsTime': time spent setting layer properties | ||
- 'drawCount': number of times the scene was rendered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
framesRedrawn
?
this.metrics.updateAttributesTime = this.stats.get('Update Attributes').time; | ||
this.metrics.framesRedrawn = this.stats.get('Redraw Count').count; | ||
this.metrics.pickTime = | ||
this.stats.get('pickObject Time').time + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just merge these three stats. I don't think anyone is using one in particular.
Simple Deck member prop that tracks performance statistics over a 60-frame window.