I'm migrating an app from New Relic, and I'm trying to use registerMetric to give me a custom metric. The metric I'm recording is a duration average, so I'm collecting durations and a count of durations so that when the callback passed to registerMetric is called I can send the average as a response and reset the accumulators. Seems straightforward, but what should I return to indicate that there is no data available for a sampling window (when my divisor is 0). I tried returning null, but then the validation logic for registerMetric said that the function must return a number.
Is there a way to signal "no data" for a custom metric, or am I doomed to have ugly data like 0's?