Add unit tests for duration metrics
As a side-effect, move utils::GetMonotonicTime() into the newly added
ClockInterface type.
BUG=None
TEST=Unit tests pass
Change-Id: I972a7e4ba37b63f96348fbeda901697b8ba2fc05
Reviewed-on: https://gerrit.chromium.org/gerrit/48814
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/system_state.h b/system_state.h
index 6f06a34..313d670 100644
--- a/system_state.h
+++ b/system_state.h
@@ -17,6 +17,7 @@
// SystemState is the root class within the update engine. So we should avoid
// any circular references in header file inclusion. Hence forward-declaring
// the required classes.
+class ClockInterface;
class ConnectionManager;
class PrefsInterface;
class PayloadStateInterface;
@@ -43,6 +44,9 @@
virtual void set_device_policy(const policy::DevicePolicy* device_policy) = 0;
virtual const policy::DevicePolicy* device_policy() const = 0;
+ // Gets the interface object for the clock.
+ virtual ClockInterface* clock() = 0;
+
// Gets the connection manager object.
virtual ConnectionManager* connection_manager() = 0;