Unify the way we process events on condition change and bucket
boundaries.
- We now always process empty data and events that exceeds the max delay
in a consistent way
- Fix one bug which caused base data not to be reset, e.g.
bucket h+1 on condition change to true, we pull the following data (key A / value 1, key B / value 2)
bucket h+2 on bucket boundary, we pull the following data (key A / value 2)
In this case the previous code, did not reset Key B. It should be reset
since it is not present in the most recent data.
Test: atest statsd_test
Bug: 124046337
Change-Id: I19456bbe1529e72befbb621be185ce24bd65077a
diff --git a/cmds/statsd/src/external/PullDataReceiver.h b/cmds/statsd/src/external/PullDataReceiver.h
index b071682..d2193f4 100644
--- a/cmds/statsd/src/external/PullDataReceiver.h
+++ b/cmds/statsd/src/external/PullDataReceiver.h
@@ -32,9 +32,10 @@
* @param data The pulled data.
* @param pullSuccess Whether the pull succeeded. If the pull does not succeed, the data for the
* bucket should be invalidated.
+ * @param originalPullTimeNs This is when all the pulls have been initiated (elapsed time).
*/
virtual void onDataPulled(const std::vector<std::shared_ptr<LogEvent>>& data,
- bool pullSuccess) = 0;
+ bool pullSuccess, int64_t originalPullTimeNs) = 0;
};
} // namespace statsd