[components] Fixes Bugs 1497879, 1497892 - Add counter metric type to glean
commite71bc7b05d5d9973e2d0f0186bdfc4fe0d1225ed
authorTravis Long <tlong@mozilla.com>
Wed, 5 Dec 2018 14:58:56 +0000 (5 08:58 -0600)
committerAlessio Placitelli <alessio.placitelli@gmail.com>
Wed, 5 Dec 2018 23:16:31 +0000 (6 00:16 +0100)
tree28284b3bb75934a80f5f2fb261b79db159bd262c
parentd137c77d675f47a290ba0ce1f873a8d4de5b81e2
[components] Fixes Bugs 14978791497892 - Add counter metric type to glean

Adds CountersStorageEngine and CounterMetricType to glean.  Updated StorageEngineManager, adding 'counter' to default storage engines.
Changed CounterMetricType to read from storage engine

Rather than using a local variable to track the current count, as this could get out of sync if app  pushed to background.  Also fixed some copypasta errors, changing "String" to "Counter".
Changes to make use of combinator and async engine

Changes per Alessio

Updated String and UUID metric type classes to internal access

Update message

Increase code coverage
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/CounterMetricType.kt [new file with mode: 0644]
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/storages/CountersStorageEngine.kt [new file with mode: 0644]
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/storages/StorageEngineManager.kt
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/storages/StringsStorageEngine.kt
mobile/android/android-components/components/service/glean/src/main/java/mozilla/components/service/glean/storages/UuidsStorageEngine.kt
mobile/android/android-components/components/service/glean/src/test/java/mozilla/components/service/glean/CounterMetricTypeTest.kt [new file with mode: 0644]
mobile/android/android-components/components/service/glean/src/test/java/mozilla/components/service/glean/storages/CountersStorageEngineTest.kt [new file with mode: 0644]