You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/01/10 06:24:56 UTC
[incubator-servicecomb-java-chassis] branch master updated: SCB-85
simple metrics write file examples
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 1157f66 SCB-85 simple metrics write file examples
1157f66 is described below
commit 1157f66ee58cfe5d15a3b6058dd47f0f2384742e
Author: zhengyangyong <ya...@huawei.com>
AuthorDate: Wed Jan 10 09:44:13 2018 +0800
SCB-85 simple metrics write file examples
Signed-off-by: zhengyangyong <ya...@huawei.com>
---
.../metrics-write-file-common/pom.xml | 36 -----------
.../metrics-write-file-config-log4j/pom.xml | 43 -------------
.../metrics-write-file-config-log4j2/pom.xml | 47 --------------
.../metrics-write-file-config/pom.xml | 32 ----------
.../metrics-write-file-log4j-springboot/pom.xml | 8 +--
.../samples/mwf/Log4JMetricsFileWriter.java | 0
.../samples/mwf/ServiceApplication.java | 13 ++--
.../io/servicecomb/samples/mwf/SimpleService.java | 0
.../metrics-write-file-log4j/pom.xml | 74 ----------------------
.../samples/mwf/ServiceApplication.java | 28 --------
.../META-INF/spring/pojo.provider.bean.xml | 26 --------
.../src/main/resources/microservice.yaml | 46 --------------
.../metrics-write-file-log4j2-springboot/pom.xml | 13 ++--
.../samples/mwf/Log4J2MetricsFileWriter.java | 0
.../io/servicecomb/samples/mwf/SimpleService.java | 0
.../metrics-write-file-log4j2/pom.xml | 74 ----------------------
.../src/main/resources/microservice.yaml | 46 --------------
.../main/resources/spring/pojo.provider.bean.xml | 26 --------
.../metrics-write-file/pom.xml | 4 --
.../servicecomb/samples/mwf/MetricsFileWriter.java | 0
.../io/servicecomb/samples/mwf/TestWriteFile.java | 7 ++
samples/metrics-write-file-sample/pom.xml | 31 ---------
22 files changed, 26 insertions(+), 528 deletions(-)
diff --git a/samples/metrics-write-file-sample/metrics-write-file-common/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-common/pom.xml
deleted file mode 100644
index def56c2..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-common/pom.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-common</artifactId>
- <dependencies>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>provider-springmvc</artifactId>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config-log4j/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-config-log4j/pom.xml
deleted file mode 100644
index dc58bf8..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-config-log4j/pom.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-config-log4j</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config-log4j2/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-config-log4j2/pom.xml
deleted file mode 100644
index 63a1689..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-config-log4j2/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-config-log4j2</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- </dependency>
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-config/pom.xml
deleted file mode 100644
index 001648d..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-config/pom.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-config</artifactId>
-
-
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/pom.xml
index 447ad59..8d6ecc4 100644
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/pom.xml
+++ b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/pom.xml
@@ -67,14 +67,12 @@
</dependency>
<dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-common</artifactId>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
</dependency>
-
- <!--metrics write file dependency-->
<dependency>
<groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j</artifactId>
+ <artifactId>metrics-write-file</artifactId>
</dependency>
</dependencies>
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config-log4j/src/main/java/io/servicecomb/samples/mwf/Log4JMetricsFileWriter.java b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/Log4JMetricsFileWriter.java
similarity index 100%
rename from samples/metrics-write-file-sample/metrics-write-file-config-log4j/src/main/java/io/servicecomb/samples/mwf/Log4JMetricsFileWriter.java
rename to samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/Log4JMetricsFileWriter.java
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
similarity index 72%
rename from samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
rename to samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
index b1a4930..bfb4354 100644
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
+++ b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
@@ -17,12 +17,15 @@
package io.servicecomb.samples.mwf;
-import io.servicecomb.foundation.common.utils.BeanUtils;
-import io.servicecomb.foundation.common.utils.Log4jUtils;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import io.servicecomb.springboot.starter.provider.EnableServiceComb;
+
+@SpringBootApplication
+@EnableServiceComb
public class ServiceApplication {
- public static void main(String[] args) throws Exception {
- Log4jUtils.init();
- BeanUtils.init();
+ public static void main(String[] args) {
+ SpringApplication.run(ServiceApplication.class, args);
}
}
diff --git a/samples/metrics-write-file-sample/metrics-write-file-common/src/main/java/io/servicecomb/samples/mwf/SimpleService.java b/samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
similarity index 100%
copy from samples/metrics-write-file-sample/metrics-write-file-common/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
copy to samples/metrics-write-file-sample/metrics-write-file-log4j-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j/pom.xml
deleted file mode 100644
index f84ef1f..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-log4j</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-bizkeeper</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-loadbalance</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>transport-highway</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>transport-rest-vertx</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-flowcontrol-qps</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>provider-springmvc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-common</artifactId>
- </dependency>
-
- <!--metrics write file dependency-->
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java b/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
deleted file mode 100644
index b1a4930..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.servicecomb.samples.mwf;
-
-import io.servicecomb.foundation.common.utils.BeanUtils;
-import io.servicecomb.foundation.common.utils.Log4jUtils;
-
-public class ServiceApplication {
- public static void main(String[] args) throws Exception {
- Log4jUtils.init();
- BeanUtils.init();
- }
-}
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/META-INF/spring/pojo.provider.bean.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/META-INF/spring/pojo.provider.bean.xml
deleted file mode 100644
index 55045d0..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/META-INF/spring/pojo.provider.bean.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
- <context:component-scan base-package="io.servicecomb.samples.mwf"/>
-</beans>
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/microservice.yaml b/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/microservice.yaml
deleted file mode 100644
index 999300a..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/resources/microservice.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-
-APPLICATION_ID: mwf
-service_description:
- name: mwf-log4j
- version: 0.0.1
-cse:
- service:
- registry:
- address: http://127.0.0.1:30100
- rest:
- address: 0.0.0.0:8080
- highway:
- address: 0.0.0.0:7070
- handler:
- chain:
- Provider:
- default: bizkeeper-provider
-
-servicecomb:
- metrics:
- #metrics double value round places,default value is 1
- round_places: 1
- file:
- root_path: ./samples/metrics-write-file-sample/metrics-write-file-log4j/target/metric/
- rolling:
- max_file_count: 10
- max_file_size : 10MB
-
- #output time,milliseconds
- window_time: 5000
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/pom.xml
index 24612e3..ee79782 100644
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/pom.xml
+++ b/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/pom.xml
@@ -57,15 +57,18 @@
</dependency>
<dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-common</artifactId>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
</dependency>
-
- <!--metrics write file dependency-->
<dependency>
<groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j2</artifactId>
+ <artifactId>metrics-write-file</artifactId>
</dependency>
+
</dependencies>
<build>
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config-log4j2/src/main/java/io/servicecomb/samples/mwf/Log4J2MetricsFileWriter.java b/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/Log4J2MetricsFileWriter.java
similarity index 100%
rename from samples/metrics-write-file-sample/metrics-write-file-config-log4j2/src/main/java/io/servicecomb/samples/mwf/Log4J2MetricsFileWriter.java
rename to samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/Log4J2MetricsFileWriter.java
diff --git a/samples/metrics-write-file-sample/metrics-write-file-common/src/main/java/io/servicecomb/samples/mwf/SimpleService.java b/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
similarity index 100%
rename from samples/metrics-write-file-sample/metrics-write-file-common/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
rename to samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j2/pom.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j2/pom.xml
deleted file mode 100644
index 863c379..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j2/pom.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>metrics-write-file-sample</artifactId>
- <groupId>io.servicecomb.samples</groupId>
- <version>0.6.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>metrics-write-file-log4j2</artifactId>
-
- <dependencies>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-bizkeeper</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-loadbalance</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>transport-highway</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>transport-rest-vertx</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>handler-flowcontrol-qps</artifactId>
- </dependency>
- <dependency>
- <groupId>io.servicecomb</groupId>
- <artifactId>provider-springmvc</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
-
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-common</artifactId>
- </dependency>
-
- <!--metrics write file dependency-->
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j2</artifactId>
- </dependency>
-
- </dependencies>
-
-</project>
\ No newline at end of file
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/microservice.yaml b/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/microservice.yaml
deleted file mode 100644
index 36522b6..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/microservice.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-
-APPLICATION_ID: mwf
-service_description:
- name: mwf-log4j2
- version: 0.0.1
-cse:
- service:
- registry:
- address: http://127.0.0.1:30100
- rest:
- address: 0.0.0.0:8080
- highway:
- address: 0.0.0.0:7070
- handler:
- chain:
- Provider:
- default: bizkeeper-provider
-
-servicecomb:
- metrics:
- #metrics double value round places,default value is 1
- round_places: 1
- file:
- root_path: ./samples/metrics-write-file-sample/metrics-write-file-log4j2/target/metric/
- rolling:
- max_file_count: 10
- max_file_size : 10MB
-
- #output time,milliseconds
- window_time: 5000
diff --git a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/spring/pojo.provider.bean.xml b/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/spring/pojo.provider.bean.xml
deleted file mode 100644
index 55045d0..0000000
--- a/samples/metrics-write-file-sample/metrics-write-file-log4j2/src/main/resources/spring/pojo.provider.bean.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
- <context:component-scan base-package="io.servicecomb.samples.mwf"/>
-</beans>
diff --git a/samples/metrics-write-file-sample/metrics-write-file/pom.xml b/samples/metrics-write-file-sample/metrics-write-file/pom.xml
index acc3e2b..cff1451 100644
--- a/samples/metrics-write-file-sample/metrics-write-file/pom.xml
+++ b/samples/metrics-write-file-sample/metrics-write-file/pom.xml
@@ -30,10 +30,6 @@
<dependencies>
<dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config</artifactId>
- </dependency>
- <dependency>
<groupId>io.servicecomb</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
diff --git a/samples/metrics-write-file-sample/metrics-write-file-config/src/main/java/io/servicecomb/samples/mwf/MetricsFileWriter.java b/samples/metrics-write-file-sample/metrics-write-file/src/main/java/io/servicecomb/samples/mwf/MetricsFileWriter.java
similarity index 100%
rename from samples/metrics-write-file-sample/metrics-write-file-config/src/main/java/io/servicecomb/samples/mwf/MetricsFileWriter.java
rename to samples/metrics-write-file-sample/metrics-write-file/src/main/java/io/servicecomb/samples/mwf/MetricsFileWriter.java
diff --git a/samples/metrics-write-file-sample/metrics-write-file/src/test/java/io/servicecomb/samples/mwf/TestWriteFile.java b/samples/metrics-write-file-sample/metrics-write-file/src/test/java/io/servicecomb/samples/mwf/TestWriteFile.java
index f3b089b..1caff57 100644
--- a/samples/metrics-write-file-sample/metrics-write-file/src/test/java/io/servicecomb/samples/mwf/TestWriteFile.java
+++ b/samples/metrics-write-file-sample/metrics-write-file/src/test/java/io/servicecomb/samples/mwf/TestWriteFile.java
@@ -39,6 +39,7 @@ import io.servicecomb.serviceregistry.api.registry.Microservice;
import io.servicecomb.serviceregistry.api.registry.MicroserviceInstance;
import io.servicecomb.serviceregistry.cache.InstanceCacheManager;
import io.servicecomb.serviceregistry.client.ServiceRegistryClient;
+import io.servicecomb.serviceregistry.client.http.MicroserviceInstances;
import io.servicecomb.serviceregistry.consumer.AppManager;
import mockit.Expectations;
@@ -103,6 +104,12 @@ public class TestWriteFile {
}
@Override
+ public MicroserviceInstances findServiceInstances(String appId, String microserviceName,
+ String microserviceVersionRule, String revision) {
+ return null;
+ }
+
+ @Override
public boolean updateMicroserviceProperties(Map<String, String> properties) {
return false;
}
diff --git a/samples/metrics-write-file-sample/pom.xml b/samples/metrics-write-file-sample/pom.xml
index 31f5b4b..f7dccde 100644
--- a/samples/metrics-write-file-sample/pom.xml
+++ b/samples/metrics-write-file-sample/pom.xml
@@ -29,13 +29,7 @@
<artifactId>metrics-write-file-sample</artifactId>
<packaging>pom</packaging>
<modules>
- <module>metrics-write-file-config</module>
<module>metrics-write-file</module>
- <module>metrics-write-file-config-log4j</module>
- <module>metrics-write-file-config-log4j2</module>
- <module>metrics-write-file-common</module>
- <module>metrics-write-file-log4j</module>
- <module>metrics-write-file-log4j2</module>
<module>metrics-write-file-log4j-springboot</module>
<module>metrics-write-file-log4j2-springboot</module>
</modules>
@@ -49,31 +43,6 @@
</dependency>
<dependency>
<groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-common</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
- <artifactId>metrics-write-file-config-log4j2</artifactId>
- <version>0.6.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>io.servicecomb.samples</groupId>
<artifactId>metrics-write-file</artifactId>
<version>0.6.0-SNAPSHOT</version>
</dependency>
--
To stop receiving notification emails like this one, please contact
['"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>'].