code: public static Optional<String> wavefrontValue(MetricValue mv) {
          // Omit NaN and Inf.
          if (mv.isInfiniteOrNaN()) return Optional.empty();
          return mv.value().map(Number::toString);
      }
docs: Create a wavefront compatible string representation of the metric value.
  
  If the metric value is empty or not representable in wavefront, an empty
  optional will be returned.