cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@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 11:16:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 2e2bfe121 -> d1f0aff92


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/d1f0aff9
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d1f0aff9
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d1f0aff9

Branch: refs/heads/3.1.x-fixes
Commit: d1f0aff92702d72d4dcdd5a8630e37a4bc807b27
Parents: 2e2bfe1
Author: reta <drreta@gmail.com>
Authored: Tue Oct 25 21:44:07 2016 -0400
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Oct 26 12:15:55 2016 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/d1f0aff9/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