tree: e4de4fc694fc36d9f8a87a447dac835d4c46da06 [path history] [tgz]
  1. meta/
  2. src/
  3. BUILD.gn
  4. METADATA.textproto
  5. README.md
src/cobalt/bin/testing/mock_cobalt/README.md

Mock Cobalt Service

This mock cobalt service is intended for uses when you want to validate that code under test is connecting to the cobalt service with the expected parameters and logging expected events.

It implements the fuchsia.metrics.MetricEventLoggerFactory and fuchsia.metrics.MetricEventLogger fidl protocols and provides an additional fuchsia.metrics.test.MetricEventLoggerQuerier fidl protocol for querying and resetting the state of the mock service.

mock_cobalt is intended to be used as described in Test Component with the fuchsia.metrics.MetricEventLoggerFactory used as an injected service. Tests can then connect to the MetricEventLoggerQuerier to assert that the expected events were logged.

The mock does not perform any validation of metrics sent against a cobalt registry. It is up to the test to check that expected event types and values are being sent by the code under test.