File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,24 @@ stats_aggregator_stop(StatsAggregator *self)
129
129
stats_aggregator_unregister (self );
130
130
}
131
131
132
+ void
133
+ stats_aggregator_reset (StatsAggregator * self )
134
+ {
135
+ main_loop_assert_main_thread ();
136
+
137
+ if (self && self -> reset )
138
+ self -> reset (self );
139
+
140
+ /* NOTE: This will align all the timers to the next period boundary that leads to
141
+ * - a consistent update time for all the aggregators
142
+ * - a consistent time period for the calculation of the aggregated value
143
+ * The latter is important because the users and our tests expect the aggregated value to be
144
+ * calculated for the same time period, and expect similar values for the same time period.
145
+ */
146
+ _stop_timer (self );
147
+ _restart_timer (self );
148
+ }
149
+
132
150
static gboolean
133
151
_is_orphaned (StatsAggregator * self )
134
152
{
Original file line number Diff line number Diff line change @@ -63,13 +63,6 @@ stats_aggregator_aggregate(StatsAggregator *self)
63
63
self -> aggregate (self );
64
64
}
65
65
66
- static inline void
67
- stats_aggregator_reset (StatsAggregator * self )
68
- {
69
- if (self && self -> reset )
70
- self -> reset (self );
71
- }
72
-
73
66
static inline gboolean
74
67
stats_aggregator_is_orphaned (StatsAggregator * self )
75
68
{
You can’t perform that action at this time.
0 commit comments