liubao68 closed pull request #498: [SCB-85] simple metrics write file examples URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/498
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): 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 def56c237..000000000 --- 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 dc58bf8e5..000000000 --- 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 63a16895c..000000000 --- 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 001648d0a..000000000 --- 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 447ad59c3..8d6ecc4f1 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 b1a4930af..bfb4354db 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% 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-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 f84ef1f24..000000000 --- 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/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 55045d091..000000000 --- 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 999300af2..000000000 --- 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 24612e3f7..ee7978261 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-log4j/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java b/samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java similarity index 66% rename from samples/metrics-write-file-sample/metrics-write-file-log4j/src/main/java/io/servicecomb/samples/mwf/ServiceApplication.java rename to samples/metrics-write-file-sample/metrics-write-file-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java index b1a4930af..fbfc01f3f 100644 --- 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-log4j2-springboot/src/main/java/io/servicecomb/samples/mwf/SimpleService.java @@ -17,12 +17,20 @@ package io.servicecomb.samples.mwf; -import io.servicecomb.foundation.common.utils.BeanUtils; -import io.servicecomb.foundation.common.utils.Log4jUtils; +import java.util.UUID; -public class ServiceApplication { - public static void main(String[] args) throws Exception { - Log4jUtils.init(); - BeanUtils.init(); +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import io.servicecomb.provider.rest.common.RestSchema; + +//simple service sim +@RestSchema(schemaId = "demoServiceEndpoint") +@RequestMapping(path = "/") +public class SimpleService { + + @GetMapping(path = "/f") + public String fun() { + return UUID.randomUUID().toString(); } } 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 863c37993..000000000 --- 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 36522b640..000000000 --- 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 55045d091..000000000 --- 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 acc3e2bac..cff145104 100644 --- a/samples/metrics-write-file-sample/metrics-write-file/pom.xml +++ b/samples/metrics-write-file-sample/metrics-write-file/pom.xml @@ -29,10 +29,6 @@ <artifactId>metrics-write-file</artifactId> <dependencies> - <dependency> - <groupId>io.servicecomb.samples</groupId> - <artifactId>metrics-write-file-config</artifactId> - </dependency> <dependency> <groupId>io.servicecomb</groupId> <artifactId>metrics-core</artifactId> 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 f3b089b7a..1caff577e 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.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; @@ -102,6 +103,12 @@ public InstanceCacheManager getInstanceCacheManager() { return null; } + @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 31f5b4bcc..f7dccde29 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> @@ -47,31 +41,6 @@ <artifactId>metrics-core</artifactId> <version>0.6.0-SNAPSHOT</version> </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> ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
