docs: @CheckForNull
    private static Double valueAsDouble(Measure measure) {
      switch (measure.getValueType()) {
        case BOOLEAN:
          return measure.getBooleanValue() ? 1.0d : 0.0d;
        case INT:
          return (double) measure.getIntValue();
        case LONG:
          return (double) measure.getLongValue();
        case DOUBLE:
          return measure.getDoubleValue();
        case NO_VALUE:
        case STRING:
        case LEVEL:
        default:
          return null;
      }
    }