praekeltfoundation / vumi-jssandbox-toolkit

Vumi JavaScript Sandbox toolkit.
BSD 3-Clause "New" or "Revised" License
7 stars 8 forks source link

Allow triggering metrics on delegator states. #210

Open hodgestar opened 9 years ago

hodgestar commented 9 years ago

Currently one can't trigger metrics helper metrics on delegator states because those don't have events fired. This is a thorny problem and I'm not entirely sure what the solution is.

justinvdm commented 9 years ago

I'm probably missing some use case, but why would someone want to measure something about a state that doesn't technically exist? For example, if you have a delegate state that delegates to a 'registered' state if someone is registered and a 'register' state if someone isn't registered, you'd maybe want to count the number of people reaching either of those, but I'm not sure why someone would want to count the thing that delegates to them.

rudigiesler commented 9 years ago

For timing metrics, you might want to know how long a user takes to complete a report. It's then easier to start the timer at the delegation state, than to have multiple metrics for each path that the delegation state delegates to. It also means one metric in the dashboard instead of multiple.

justinvdm commented 9 years ago

Ah, there's the use case I was missing, thanks.