Skip to content
Commit dec15280 authored by Neil Fuller's avatar Neil Fuller
Browse files

Wire up geotz metrics to the real metrics code

This adds a pull metric to capture time_zone_detector state, and push
metric code to the RealProviderMetricsLogger for recording
LocationTimeZoneProvider state changes.

Tested with instructions from http://go/westworld-create-atom:
m statsd_testdrive

Testing the pull atom:

$ statsd_testdrive 10099
...
metric_id: 1111
gauge_metrics {
  data {
    bucket_info {
      atom {
        time_zone_detector_state {
          telephony_supported: true
          geo_supported: true
          location_enabled: true
          auto_detection_setting: true
          geo_detection_setting: true
          detection_mode: GEO
          device_time_zone_ordinal: 0
          latest_telephony_suggestion {
            type: CERTAIN
            time_zone_ordinals: 0
          }
          latest_geo_suggestion {
            type: CERTAIN
            time_zone_ordinals: 0
          }
        }
      }
      elapsed_timestamp_nanos: 4997012144302
      bucket_num: 83
    }
  }
}
time_base_elapsed_nano_seconds: 9457122554
bucket_size_nano_seconds: 60000000000
is_active: true

Testing the push atoms:

$ statsd_testdrive 342
<Toggled tz detection off and on,  location tz detection off and on,
etc.>

metric_id: 1111
event_metrics {
  data {
    elapsed_timestamp_nanos: 136166610854
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: STOPPED
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 136166870437
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 1
        state: STOPPED
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 138413619828
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: INITIALIZING
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 143320553546
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: STOPPED
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 145668774196
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: INITIALIZING
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 149896281961
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: STOPPED
      }
    }
  }
  data {
    elapsed_timestamp_nanos: 151686869171
    atom {
      location_time_zone_provider_state_reported {
        provider_index: 0
        state: INITIALIZING
      }
    }
  }
}
is_active: true

Bug: 172934905
Test: See above
Change-Id: I85b3ca4abd670bd5a339111f3c30a8e0bc57579c
parent 27ddc8f4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment