impl-node: calculate stats at cycle start

Calculate the stats at the start of the new cycle. The results will be
about the previous cycle but this gives more accurate results because
we can also include awake and finish times of remote nodes.

Make sure not to change the status of the activation in the ready event
so that we don't overwrite the status of the last cycle yet.

This means we can always set the AWAKE and awake_time, the remote node
might update it when triggered but that's ok.

After processing we can update the FINISHED state for non-remote nodes,
the remote nodes will update it after they complete the process
function.
This commit is contained in:
Wim Taymans 2023-04-27 09:20:04 +02:00
parent e7a9dcfacc
commit 3cae535da0
2 changed files with 37 additions and 46 deletions

View file

@ -1190,7 +1190,6 @@ static int node_ready(void *d, int status)
}
a->state[0].status = status;
a->status = PW_NODE_ACTIVATION_TRIGGERED;
spa_system_clock_gettime(data_system, CLOCK_MONOTONIC, &ts);
a->signal_time = SPA_TIMESPEC_TO_NSEC(&ts);