Add UpdateEngine.Attempt.ConnectionType metric.
This adds a new metric so we can track the how the device is connected
to the Internet when an attempt starts.
BUG=chromium:358339
TEST=New unit test + unit tests pass.
Change-Id: Ic5c2f50e2396e6baa288aca70906f7112ef7bca9
Reviewed-on: https://chromium-review.googlesource.com/192864
Reviewed-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/utils.h b/utils.h
index 482f81a..77ed9d9 100644
--- a/utils.h
+++ b/utils.h
@@ -20,9 +20,10 @@
#include "metrics/metrics_library.h"
#include "update_engine/action.h"
+#include "update_engine/action_processor.h"
+#include "update_engine/connection_manager.h"
#include "update_engine/constants.h"
#include "update_engine/metrics.h"
-#include "update_engine/action_processor.h"
namespace chromeos_update_engine {
@@ -350,6 +351,10 @@
// can use utils::GetDownloadError() to get more detail.
metrics::AttemptResult GetAttemptResult(ErrorCode code);
+// Calculates the internet connection type given |type| and |tethering|.
+metrics::ConnectionType GetConnectionType(NetworkConnectionType type,
+ NetworkTethering tethering);
+
// Sends the error code to UMA using the metrics interface object in the given
// system state. It also uses the system state to determine the right UMA
// bucket for the error code.