title: Why am I not getting hystrix metrics?
body: <p>I am trying to use hystrix to monitor a certain network call. But all the metrics I try to monitor are always empty. What am I doing wrong?</p>
  
  <p>I simulate a network call by implementing a (somewhat) RESTful interface that returns a pow calculation:</p>
  
  <pre><code>GetPowerCommand gpc = new GetPowerCommand(5, 82);
  powerMetrics = gpc.getMetrics();
  </code></pre>
  
  <p>This is how I call the hystrix command and expect to get some metrics (at least Requests: not 0)</p>
  
  <pre><code>boolean run = true;
  while (run) {
      try {
          Thread.sleep(1000);
      } catch (InterruptedException e) {
          e.printStackTrace();
          run = false;
      }
      System.out.println("GetPowerCommand.run(): " + gpc.run());
      System.out.println("GetPowerCommand.run(): " + gpc.run());
      System.out.println("getStatsStringFromMetrics(powerMetrics): " + getStatsStringFromMetrics(powerMetrics));
  }
  </code></pre>
  
  <p>But all I get is:</p>
  
  <pre><code>GetPowerCommand.run(): &lt;p&gt;I guess .. &lt;/p&gt;&lt;p&gt;2^5 = 32&lt;/p&gt;
  GetPowerCommand.run(): &lt;p&gt;I guess .. &lt;/p&gt;&lt;p&gt;2^5 = 32&lt;/p&gt;
  getStatsStringFromMetrics(powerMetrics): Requests: 0 Errors: 0 (0%)   Mean: 0 50th: 0 75th: 0 90th: 0 99th: 0 
  GetPowerCommand.run(): &lt;p&gt;I guess .. &lt;/p&gt;&lt;p&gt;2^5 = 32&lt;/p&gt;
  GetPowerCommand.run(): &lt;p&gt;I guess .. &lt;/p&gt;&lt;p&gt;2^5 = 32&lt;/p&gt;
  getStatsStringFromMetrics(powerMetrics): Requests: 0 Errors: 0 (0%)   Mean: 0 50th: 0 75th: 0 90th: 0 99th: 0 
  </code></pre>
  
  <p>edit: my metrics retrieval method:</p>
  
  <pre><code>private static String getStatsStringFromMetrics(HystrixCommandMetrics metrics) {
      StringBuilder m = new StringBuilder();
      if (metrics != null) {
          HealthCounts health = metrics.getHealthCounts();
          m.append("Requests: ").append(health.getTotalRequests()).append(" ");
          m.append("Errors: ").append(health.getErrorCount()).append(" (").append(health.getErrorPercentage())
                  .append("%)   ");
          m.append("Mean: ").append(metrics.getTotalTimeMean()).append(" ");
          m.append("50th: ").append(metrics.getExecutionTimePercentile(50)).append(" ");
          m.append("75th: ").append(metrics.getExecutionTimePercentile(75)).append(" ");
          m.append("90th: ").append(metrics.getExecutionTimePercentile(90)).append(" ");
          m.append("99th: ").append(metrics.getExecutionTimePercentile(99)).append(" ");
      }
      return m.toString();
  }
  </code></pre>