code: public static Optional<Timer.Context> timerContext(Optional<MetricContext> context, final String name) {
      return context.transform(new Function<MetricContext, Timer.Context>() {
        @Override
        public Timer.Context apply(@Nonnull MetricContext input) {
          return input.timer(name).time();
        }
      });
    }
docs: Returns a {@link com.codahale.metrics.Timer.Context} only if {@link org.apache.gobblin.metrics.MetricContext} is defined.
  @param context an Optional&lt;{@link org.apache.gobblin.metrics.MetricContext}$gt;
  @param name name of the timer.
  @return an Optional&lt;{@link com.codahale.metrics.Timer.Context}$gt;