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

Metrics-tracking Deck property #3139

Merged
merged 7 commits into from May 31, 2019
Merged

Metrics-tracking Deck property #3139

merged 7 commits into from May 31, 2019

Conversation

tsherif
Copy link
Contributor

@tsherif tsherif commented May 24, 2019

Simple Deck member prop that tracks performance statistics over a 60-frame window.

@coveralls
Copy link

coveralls commented May 24, 2019

Coverage Status

Coverage increased (+0.9%) to 62.901% when pulling 17a2953 on metrics-prop into 6136bc7 on master.


#### metrics

A map of various performance statistics for the last 60 frames of rendering.
Copy link
Collaborator

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?

- '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
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@tsherif
Copy link
Contributor Author

tsherif commented May 29, 2019

@Pessimistress this actually worked out pretty well. Decided to pull some stats in from luma as well.

- '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
Copy link
Collaborator

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"?

/* 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')
Copy link
Collaborator

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.

Copy link
Contributor Author

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

- '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
Copy link
Collaborator

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 +
Copy link
Collaborator

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.

@tsherif tsherif merged commit 3524894 into master May 31, 2019
@Pessimistress Pessimistress deleted the metrics-prop branch June 4, 2019 05:19
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.

None yet

3 participants