docs: public static <T> ToDoubleFunction<T> invokeMethod(final Method method) {
      method.setAccessible(true);
      return (obj) -> {
        try {
          final Number n = (Number) method.invoke(obj);
          return n.doubleValue();
        } catch (Exception e) {
          LOGGER.warn("exception from method registered as a gauge [" + method + "]", e);
          return Double.NaN;
        }
      };
    }