Skip to main content
Checks a metrics response against the metrics the manifest declares and returns what is wrong with it.

Parameters

response

unknown

metrics

MetricDeclaration[]

Returns

string[]

Remarks

Returns an empty array when the response is sound, so a test asserts on an empty list. It reports a body that is not { series: [...] }, an entry with no metric key, a metric the declarations do not name, a unit that disagrees with the declared one, a missing points array, and any point that is not a [string, number] pair. It does not check that every declared metric is answered, so assert on the length yourself when that matters. The strings are the ones tappify extension doctor reports.

Example