clockworklabs / SpacetimeDB

Multiplayer at the speed of light
https://spacetimedb.com
Other
4.12k stars 100 forks source link

Combine reducer and incremental update duration metrics #1168

Closed joshua-spacetime closed 1 week ago

joshua-spacetime commented 2 weeks ago

Right now reducer durations and incremental update durations are tracked using two different metrics. We should also have a metric that combines them since a reducer call and an incremental update are logically an atomic unit of execution.

This will give users additional observability into their reducers as they'll be able to see which reducers have more expensive incremental updates.

Note this will be a natural fallout of #1157 since both will be executed as part of the same transaction, but we'll want to make sure to maintain the separated metrics as well.

Shubham8287 commented 2 weeks ago

I think this is the combined metrics that we already have - https://github.com/clockworklabs/SpacetimeDB/blob/27a7b676085037c382b95804780ed2ae3c46acd6/crates/core/src/client/message_handlers.rs#L185?

joshua-spacetime commented 2 weeks ago

@Shubham8287 I'd like to only account for transaction processing time vs the entire time spent on the server. I believe that metric tracks the latter, although correct me if I'm wrong.

Shubham8287 commented 2 weeks ago

@Shubham8287 I'd like to only account for transaction processing time vs the entire time spent on the server. I believe that metric tracks the latter, although correct me if I'm wrong.

You are right, this metric measure entier time spent.