james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [07/14] james-project git commit: JAMES-1950 Move metrics-dropwizard as toplevel projects
Date Fri, 03 Mar 2017 17:26:15 GMT
JAMES-1950 Move metrics-dropwizard as toplevel projects


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c06aeac8
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c06aeac8
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c06aeac8

Branch: refs/heads/master
Commit: c06aeac882121218332211b5593c53e228ec8da1
Parents: 4e70111
Author: Antoine Duprat <aduprat@linagora.com>
Authored: Tue Feb 28 10:02:20 2017 +0100
Committer: Antoine Duprat <aduprat@linagora.com>
Committed: Fri Mar 3 18:17:20 2017 +0100

----------------------------------------------------------------------
 metrics/metrics-dropwizard/pom.xml              | 61 +++++++++++++++++++
 .../metrics/dropwizard/DropWizardMetric.java    | 43 ++++++++++++++
 .../dropwizard/DropWizardMetricFactory.java     | 58 ++++++++++++++++++
 metrics/pom.xml                                 | 51 ++++++++++++++++
 server/app/pom.xml                              |  2 +-
 server/container/guice/guice-common/pom.xml     |  2 +-
 .../metrics/metrics-dropwizard/pom.xml          | 62 --------------------
 .../metrics/dropwizard/DropWizardMetric.java    | 43 --------------
 .../dropwizard/DropWizardMetricFactory.java     | 58 ------------------
 .../metrics/metrics-es-reporter/pom.xml         |  2 +-
 server/pom.xml                                  | 11 ++--
 11 files changed, 221 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/metrics/metrics-dropwizard/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/metrics-dropwizard/pom.xml b/metrics/metrics-dropwizard/pom.xml
new file mode 100644
index 0000000..7b1dec8
--- /dev/null
+++ b/metrics/metrics-dropwizard/pom.xml
@@ -0,0 +1,61 @@
+<?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</artifactId>
+        <groupId>org.apache.james</groupId>
+        <version>3.0.0-beta6-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>metrics-dropwizard</artifactId>
+
+    <name>Apache James :: Metrics :: Dropwizard</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-filesystem-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>james-server-lifecycle-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>metrics-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>javax.inject</groupId>
+            <artifactId>javax.inject</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
----------------------------------------------------------------------
diff --git a/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
b/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
new file mode 100644
index 0000000..1e55395
--- /dev/null
+++ b/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
@@ -0,0 +1,43 @@
+/****************************************************************
+ * 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 org.apache.james.metrics.dropwizard;
+
+import org.apache.james.metrics.api.Metric;
+
+import com.codahale.metrics.Counter;
+
+public class DropWizardMetric implements Metric {
+
+    private final Counter counter;
+
+    public DropWizardMetric(Counter counter) {
+        this.counter = counter;
+    }
+
+    @Override
+    public void increment() {
+        counter.inc();
+    }
+
+    @Override
+    public void decrement() {
+        counter.dec();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
----------------------------------------------------------------------
diff --git a/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
b/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
new file mode 100644
index 0000000..4eee021
--- /dev/null
+++ b/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
@@ -0,0 +1,58 @@
+/****************************************************************
+ * 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 org.apache.james.metrics.dropwizard;
+
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.metrics.api.Metric;
+import org.apache.james.metrics.api.MetricFactory;
+
+import com.codahale.metrics.JmxReporter;
+import com.codahale.metrics.MetricRegistry;
+
+public class DropWizardMetricFactory implements MetricFactory {
+
+    private final MetricRegistry metricRegistry;
+    private final JmxReporter jmxReporter;
+
+    @Inject
+    public DropWizardMetricFactory(MetricRegistry metricRegistry) {
+        this.metricRegistry = metricRegistry;
+        this.jmxReporter = JmxReporter.forRegistry(metricRegistry)
+            .build();
+    }
+
+    @Override
+    public Metric generate(String name) {
+        return new DropWizardMetric(metricRegistry.counter(name));
+    }
+
+    public void start() throws ConfigurationException {
+        jmxReporter.start();
+    }
+
+    @PreDestroy
+    public void stop() {
+        jmxReporter.stop();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/metrics/pom.xml
----------------------------------------------------------------------
diff --git a/metrics/pom.xml b/metrics/pom.xml
index 2653b90..f6b854e 100644
--- a/metrics/pom.xml
+++ b/metrics/pom.xml
@@ -34,7 +34,58 @@
 
     <modules>
         <module>metrics-api</module>
+        <module>metrics-dropwizard</module>
     </modules>
 
+    <properties>
+        <assertj-3.version>3.3.0</assertj-3.version>
+        <es.version>2.2.1</es.version>
+        <es-reporter.version>2.2.0</es-reporter.version>
+        <guava.version>18.0</guava.version>
+        <javax.inject.version>1</javax.inject.version>
+        <junit.version>4.11</junit.version>
+        <metrics.version>3.1.0</metrics.version>
+        <testcontainers-version>1.1.7</testcontainers-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>james-server-filesystem-api</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>james-server-lifecycle-api</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>metrics-api</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>metrics-dropwizard</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>${guava.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.dropwizard.metrics</groupId>
+                <artifactId>metrics-core</artifactId>
+                <version>${metrics.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.inject</groupId>
+                <artifactId>javax.inject</artifactId>
+                  <version>${javax.inject.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
 </project>
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/app/pom.xml
----------------------------------------------------------------------
diff --git a/server/app/pom.xml b/server/app/pom.xml
index 306f51b..dc9f666 100644
--- a/server/app/pom.xml
+++ b/server/app/pom.xml
@@ -257,7 +257,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.james</groupId>
-            <artifactId>james-server-metrics-dropwizard</artifactId>
+            <artifactId>metrics-dropwizard</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.james</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/container/guice/guice-common/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/pom.xml b/server/container/guice/guice-common/pom.xml
index f3f46cb..3f6c984 100644
--- a/server/container/guice/guice-common/pom.xml
+++ b/server/container/guice/guice-common/pom.xml
@@ -197,7 +197,7 @@
                 </dependency>
                 <dependency>
                     <groupId>org.apache.james</groupId>
-                    <artifactId>james-server-metrics-dropwizard</artifactId>
+                    <artifactId>metrics-dropwizard</artifactId>
                 </dependency>
                 <dependency>
                     <groupId>${project.groupId}</groupId>

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/container/metrics/metrics-dropwizard/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/metrics/metrics-dropwizard/pom.xml b/server/container/metrics/metrics-dropwizard/pom.xml
deleted file mode 100644
index 33a2fe3..0000000
--- a/server/container/metrics/metrics-dropwizard/pom.xml
+++ /dev/null
@@ -1,62 +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>james-server</artifactId>
-        <groupId>org.apache.james</groupId>
-        <version>3.0.0-beta6-SNAPSHOT</version>
-        <relativePath>../../../pom.xml</relativePath>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>james-server-metrics-dropwizard</artifactId>
-
-    <name>Apache James :: Server :: Metrics :: Dropwizard</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>james-server-filesystem-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>james-server-lifecycle-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.james</groupId>
-            <artifactId>metrics-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.dropwizard.metrics</groupId>
-            <artifactId>metrics-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.inject</groupId>
-            <artifactId>javax.inject</artifactId>
-        </dependency>
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
----------------------------------------------------------------------
diff --git a/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
b/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
deleted file mode 100644
index 1e55395..0000000
--- a/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetric.java
+++ /dev/null
@@ -1,43 +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 org.apache.james.metrics.dropwizard;
-
-import org.apache.james.metrics.api.Metric;
-
-import com.codahale.metrics.Counter;
-
-public class DropWizardMetric implements Metric {
-
-    private final Counter counter;
-
-    public DropWizardMetric(Counter counter) {
-        this.counter = counter;
-    }
-
-    @Override
-    public void increment() {
-        counter.inc();
-    }
-
-    @Override
-    public void decrement() {
-        counter.dec();
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
----------------------------------------------------------------------
diff --git a/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
b/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
deleted file mode 100644
index 4eee021..0000000
--- a/server/container/metrics/metrics-dropwizard/src/main/java/org/apache/james/metrics/dropwizard/DropWizardMetricFactory.java
+++ /dev/null
@@ -1,58 +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 org.apache.james.metrics.dropwizard;
-
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.james.metrics.api.Metric;
-import org.apache.james.metrics.api.MetricFactory;
-
-import com.codahale.metrics.JmxReporter;
-import com.codahale.metrics.MetricRegistry;
-
-public class DropWizardMetricFactory implements MetricFactory {
-
-    private final MetricRegistry metricRegistry;
-    private final JmxReporter jmxReporter;
-
-    @Inject
-    public DropWizardMetricFactory(MetricRegistry metricRegistry) {
-        this.metricRegistry = metricRegistry;
-        this.jmxReporter = JmxReporter.forRegistry(metricRegistry)
-            .build();
-    }
-
-    @Override
-    public Metric generate(String name) {
-        return new DropWizardMetric(metricRegistry.counter(name));
-    }
-
-    public void start() throws ConfigurationException {
-        jmxReporter.start();
-    }
-
-    @PreDestroy
-    public void stop() {
-        jmxReporter.stop();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/container/metrics/metrics-es-reporter/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/metrics/metrics-es-reporter/pom.xml b/server/container/metrics/metrics-es-reporter/pom.xml
index a4a9fce..706ab5b 100644
--- a/server/container/metrics/metrics-es-reporter/pom.xml
+++ b/server/container/metrics/metrics-es-reporter/pom.xml
@@ -132,7 +132,7 @@
                 </dependency>
                 <dependency>
                     <groupId>org.apache.james</groupId>
-                    <artifactId>james-server-metrics-dropwizard</artifactId>
+                    <artifactId>metrics-dropwizard</artifactId>
                     <scope>test</scope>
                 </dependency>
                 <dependency>

http://git-wip-us.apache.org/repos/asf/james-project/blob/c06aeac8/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index dd58ac7..f879e80 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -63,7 +63,6 @@
         <module>container/jetty</module>
         <module>container/lifecycle-api</module>
         <module>container/mailbox-adapter</module>
-        <module>container/metrics/metrics-dropwizard</module>
         <module>container/metrics/metrics-es-reporter</module>
         <module>container/spring</module>
         <module>container/util</module>
@@ -456,6 +455,11 @@
                 <artifactId>metrics-api</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>metrics-dropwizard</artifactId>
+                <version>${project.version}</version>
+            </dependency>
 
             <dependency>
                 <groupId>org.apache.james.protocols</groupId>
@@ -643,11 +647,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
-                <artifactId>james-server-metrics-dropwizard</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.james</groupId>
                 <artifactId>james-server-jmap</artifactId>
                 <version>${project.version}</version>
             </dependency>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message