cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: Updated Spring Boot demos. Added metrics filtering based on CXF and application metric registry only
Date Wed, 26 Oct 2016 01:44:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e6d2a5121 -> 70e1cbf0a


Updated Spring Boot demos. Added metrics filtering based on CXF and application metric registry
only


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/70e1cbf0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/70e1cbf0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/70e1cbf0

Branch: refs/heads/master
Commit: 70e1cbf0a1a48edd7da5ef25c371e352a95e79a2
Parents: e6d2a51
Author: reta <drreta@gmail.com>
Authored: Tue Oct 25 21:44:07 2016 -0400
Committer: reta <drreta@gmail.com>
Committed: Tue Oct 25 21:44:07 2016 -0400

----------------------------------------------------------------------
 .../sample/rs/service/SampleRestApplication.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/70e1cbf0/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
index ca9c445..e146a7f 100644
--- a/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
+++ b/distribution/src/main/release/samples/jax_rs/spring_boot_scan/application/src/main/java/sample/rs/service/SampleRestApplication.java
@@ -17,13 +17,32 @@
  * under the License.
  */
 package sample.rs.service;
+import java.util.Collections;
+
 import org.springframework.boot.SpringApplication;
+import org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics;
+import org.springframework.boot.actuate.endpoint.MetricsEndpoint;
+import org.springframework.boot.actuate.metrics.reader.MetricRegistryMetricReader;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.context.annotation.Bean;
+
+import com.codahale.metrics.MetricRegistry;
 
 @SpringBootApplication
 @EnableEurekaClient
 public class SampleRestApplication {
+    @Bean
+    public MetricRegistry metricRegistry(){
+        return new MetricRegistry();
+    }
+    
+    @Bean
+    public MetricsEndpoint metricsEndpoint(final MetricRegistry registry) {
+        return new MetricsEndpoint(Collections.singleton(new MetricReaderPublicMetrics(
+            new MetricRegistryMetricReader(registry))));
+    }
+
     public static void main(String[] args) {
         SpringApplication.run(SampleRestApplication.class, args);
     }


Mime
View raw message