Package org.springframework.boot.actuate.endpoint

Examples of org.springframework.boot.actuate.endpoint.MetricsEndpoint


    List<PublicMetrics> publicMetrics = new ArrayList<PublicMetrics>();
    if (this.publicMetrics != null) {
      publicMetrics.addAll(this.publicMetrics);
    }
    Collections.sort(publicMetrics, AnnotationAwareOrderComparator.INSTANCE);
    return new MetricsEndpoint(publicMetrics);
  }
View Full Code Here


  }

  @Test
  public void metricEndpointsHasSystemMetricsByDefault() {
    load(PublicMetricsAutoConfiguration.class, EndpointAutoConfiguration.class);
    MetricsEndpoint endpoint = this.context.getBean(MetricsEndpoint.class);
    Map<String, Object> metrics = endpoint.invoke();
    assertTrue(metrics.containsKey("mem"));
    assertTrue(metrics.containsKey("heap.used"));
  }
View Full Code Here

  @Test
  public void metricEndpointCustomPublicMetrics() {
    load(CustomPublicMetricsConfig.class, PublicMetricsAutoConfiguration.class,
        EndpointAutoConfiguration.class);
    MetricsEndpoint endpoint = this.context.getBean(MetricsEndpoint.class);
    Map<String, Object> metrics = endpoint.invoke();

    // Custom metrics
    assertTrue(metrics.containsKey("foo"));

    // System metrics still available
View Full Code Here

TOP

Related Classes of org.springframework.boot.actuate.endpoint.MetricsEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.