@Test
  public void canBeEnabledManually() throws Exception {
    ConnectionFactory cf = new ConnectionFactoryBuilder()
      .setEnableMetrics(MetricType.PERFORMANCE)
      .build();

    assertEquals(MetricType.PERFORMANCE, cf.enableMetrics());
    assertTrue(cf.getMetricCollector() instanceof DefaultMetricCollector);

    System.setProperty("net.spy.metrics.enable", "true");
    System.setProperty("net.spy.metrics.type", "performance");
    cf = new ConnectionFactoryBuilder().build();
    assertEquals(MetricType.PERFORMANCE, cf.enableMetrics());
    assertTrue(cf.getMetricCollector() instanceof DefaultMetricCollector);
  }
Tests the initialization and measurement of Metrics.
src/test/java/net/spy/memcached/MetricsTest.java