Skip to content
This repository has been archived by the owner on May 3, 2019. It is now read-only.

Show the number of digest cycles in the graph #22

Open
hrajchert opened this issue Mar 20, 2015 · 5 comments
Open

Show the number of digest cycles in the graph #22

hrajchert opened this issue Mar 20, 2015 · 5 comments

Comments

@hrajchert
Copy link

In adition to knowing how long it takes, it would be nice if it showed how many digest are triggered in a certain time frame (maybe 5 seconds)

@kentcdodds
Copy link
Owner

That would be useful for sure! What kind of an api would you expect for this? Would this be a button to start/stop or something you enter in the console? Both? What did you have in mind?

@hrajchert
Copy link
Author

I was thinking to have it in the graph.

Number of watch | time of last digest | digest per second

The number of watch is normal to have the current information, but the time of cycle and cycle per second normally have more sense in terms of actions and is more util the average information than the current one.

When I scroll, or mouse over, or click on an element, how many digest cycles do I trigger? What is the average time for that?. The graph is useful in the sense that you can play with your page and visually see the changes, the only missing data is how many digest occur in a time frame (1 sec, 5 sec).

Probably in an API I would allow the time frame to be configurable, and maybe expose an array of the different buckets as you do with logDigest and logWatches or
ngStats.listeners.digestCount.nameOfYourListener

What do you think?

@kentcdodds
Copy link
Owner

I like this a lot. What if you had something like this:

showAngularStats({
  averagePer: 5000
});

Providing that would give you:

Number of watches (currently) | average digest time during the last 5 seconds | digests in the last 5 seconds

I think this would be very useful.

@hrajchert
Copy link
Author

I like that!
You can always have the last digest time using the existing event listener.

And if people miss to have it in the graph you can optionally add an option to showAngularStats to show it.

@kentcdodds
Copy link
Owner

sounds good. I'm swamped right now, but I'll try to get to this as soon as I'm able. Feel free to make a PR :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants