public String getName() {
    return name;
  }
@Test
  public void metricsRegistered() {
    Configuration conf = new Configuration();
    DecayRpcScheduler scheduler = new DecayRpcScheduler(4, "ipc.8020", conf);
    MetricsSystem metricsSystem = DefaultMetricsSystem.instance();
    DecayRpcSchedulerDetailedMetrics metrics =
        scheduler.getDecayRpcSchedulerDetailedMetrics();

    assertNotNull(metricsSystem.getSource(metrics.getName()));

    scheduler.stop();

    assertNull(metricsSystem.getSource(metrics.getName()));
  }