public void updateRecreateAndSyncDurationInMs(long durationInNs) {
    if (metricsConfig.isMetricsOn()) {
      long durationInMs = getDurationInMs(durationInNs);
      LOG.info("Sending recreate and sync metrics {}", durationInMs);
      metrics.registerGauge(getMetricsName(META_SYNC_ACTION, RECREATE_TABLE_DURATION_MS_METRIC), durationInMs);
    }
  }
@Test
  void testUpdateRecreateAndSyncDurationInMs() throws InterruptedException {
    Timer.Context timerCtx = hoodieSyncMetrics.getRecreateAndSyncTimer();
    Thread.sleep(5);
    long durationInNs = timerCtx.stop();
    hoodieSyncMetrics.updateRecreateAndSyncDurationInMs(durationInNs);
    String metricName = hoodieSyncMetrics.getMetricsName("meta_sync", "recreate_table_duration_ms");
    long timeIsMs = (Long) metrics.getRegistry().getGauges().get(metricName).getValue();
    assertTrue(timeIsMs > 0, "recreate_table duration metric value should be > 0");
  }