private static void initStats()

in client/src/main/java/com/google/cloud/solutions/opencensus/client/TestInstrumentation.java [98:124]


  private static void initStats() throws IOException {
    // Exponential with growth factor of 1.25, rounded to nearest 1 ms.
    Aggregation latencyDist =
        Distribution.create(
            BucketBoundaries.create(
                Arrays.asList(
                    1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 12.0, 15.0, 18.0, 23.0, 28.0, 36.0,
                    44.0, 56.0, 69.0, 87.0, 108.0, 136.0, 169.0, 212.0, 265.0, 331.0, 414.0, 517.0,
                    646.0, 808.0, 1010.0, 1262.0, 1578.0, 1972.0, 2465.0, 3081.0, 3852.0, 4815.0,
                    6019.0, 7523.0, 9404.0, 11755.0, 14694.0, 18367.0, 22959.0, 28699.0, 35873.0,
                    44842.0, 56052.0)));
    View[] views =
        new View[] {
          View.create(
              Name.create("octail/latency"),
              "Distribution of latencies",
              M_LATENCY_MS,
              latencyDist,
              Collections.unmodifiableList(Arrays.asList(KEY_METHOD)))
        };
    ViewManager vmgr = Stats.getViewManager();
    for (View view : views) {
      vmgr.registerView(view);
    }
    HttpViews.registerAllClientViews();
    StackdriverStatsExporter.createAndRegister();
  }