shill: cellular: Add metric to track out-of-credits detection.

BUG=chromium:233452
TEST=Unit tests

Change-Id: Idcb5cabc44892a2ed5bd3c4fe8768fe734155e3c
Reviewed-on: https://gerrit.chromium.org/gerrit/48829
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
diff --git a/metrics.h b/metrics.h
index 614cf86..c4971f2 100644
--- a/metrics.h
+++ b/metrics.h
@@ -197,6 +197,13 @@
     kCellularDropTechnologyMax
   };
 
+  enum CellularOutOfCreditsReason {
+    kCellularOutOfCreditsReasonConnectDisconnectLoop = 0,
+    kCellularOutOfCreditsReasonTxCongested = 1,
+    kCellularOutOfCreditsReasonElongatedTimeWait = 2,
+    kCellularOutOfCreditsReasonMax
+  };
+
   enum CorruptedProfile {
     kCorruptedProfile = 1,
     kCorruptedProfileMax
@@ -344,16 +351,6 @@
   static const char kMetricServiceFixupEntries[];
 
   // Cellular specific statistics.
-  static const char kMetricCellularDrop[];
-  static const char kMetricCellularDropsPerHour[];
-  static const int kMetricCellularDropsPerHourMax;
-  static const int kMetricCellularDropsPerHourMin;
-  static const int kMetricCellularDropsPerHourNumBuckets;
-  static const char kMetricCellularFailureReason[];
-  static const char kMetricCellularSignalStrengthBeforeDrop[];
-  static const int kMetricCellularSignalStrengthBeforeDropMax;
-  static const int kMetricCellularSignalStrengthBeforeDropMin;
-  static const int kMetricCellularSignalStrengthBeforeDropNumBuckets;
   static const char kMetricCellularAutoConnectTries[];
   static const int kMetricCellularAutoConnectTriesMax;
   static const int kMetricCellularAutoConnectTriesMin;
@@ -362,6 +359,17 @@
   static const int kMetricCellularAutoConnectTotalTimeMax;
   static const int kMetricCellularAutoConnectTotalTimeMin;
   static const int kMetricCellularAutoConnectTotalTimeNumBuckets;
+  static const char kMetricCellularDrop[];
+  static const char kMetricCellularDropsPerHour[];
+  static const int kMetricCellularDropsPerHourMax;
+  static const int kMetricCellularDropsPerHourMin;
+  static const int kMetricCellularDropsPerHourNumBuckets;
+  static const char kMetricCellularFailureReason[];
+  static const char kMetricCellularOutOfCreditsReason[];
+  static const char kMetricCellularSignalStrengthBeforeDrop[];
+  static const int kMetricCellularSignalStrengthBeforeDropMax;
+  static const int kMetricCellularSignalStrengthBeforeDropMin;
+  static const int kMetricCellularSignalStrengthBeforeDropNumBuckets;
 
   // Profile statistics.
   static const char kMetricCorruptedProfile[];
@@ -510,6 +518,10 @@
   // Notifies this object about a cellular device failure code.
   void NotifyCellularDeviceFailure(const Error &error);
 
+  // Notifies this object that a cellular service has been marked as
+  // out-of-credits.
+  void NotifyCellularOutOfCredits(Metrics::CellularOutOfCreditsReason reason);
+
   // Notifies this object about a corrupted profile.
   virtual void NotifyCorruptedProfile();