Skip to content

Commit

Permalink
support java 6
Browse files Browse the repository at this point in the history
  • Loading branch information
qingliang.ql committed Jan 9, 2019
1 parent 72f6990 commit 052901f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 81 deletions.
12 changes: 0 additions & 12 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@

<name>nacos-client ${project.version}</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.alibaba.nacos.client.monitor;

import io.micrometer.core.instrument.ImmutableTag;
import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Timer;
Expand All @@ -34,19 +35,19 @@ public class MetricsMonitor {
private static AtomicInteger listenConfigCount = new AtomicInteger();

static {
List<Tag> tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "subServiceCount"));
List<Tag> tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "subServiceCount"));
Metrics.gauge("nacos_monitor", tags, serviceInfoMapSize);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "pubServiceCount"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "pubServiceCount"));
Metrics.gauge("nacos_monitor", tags, dom2BeatSize);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "listenConfigCount"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "listenConfigCount"));
Metrics.gauge("nacos_monitor", tags, listenConfigCount);
}

Expand Down
8 changes: 0 additions & 8 deletions config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,6 @@
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
<!-- <resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/
package com.alibaba.nacos.config.server.monitor;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Timer;
import io.micrometer.core.instrument.*;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -38,34 +35,34 @@ public class MetricsMonitor {
private static AtomicInteger dumpTask = new AtomicInteger();

static {
List<Tag> tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "getConfig"));
List<Tag> tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "getConfig"));
Metrics.gauge("nacos_monitor", tags, getConfig);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "publish"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "publish"));
Metrics.gauge("nacos_monitor", tags, publish);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "longPolling"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "longPolling"));
Metrics.gauge("nacos_monitor", tags, longPolling);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "configCount"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "configCount"));
Metrics.gauge("nacos_monitor", tags, configCount);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "notifyTask"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "notifyTask"));
Metrics.gauge("nacos_monitor", tags, notifyTask);

tags = new ArrayList<>();
tags.add(Tag.of("module", "config"));
tags.add(Tag.of("name", "dumpTask"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "config"));
tags.add(new ImmutableTag("name", "dumpTask"));

Metrics.gauge("nacos_monitor", tags, dumpTask);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.alibaba.nacos.naming.monitor;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.ImmutableTag;
import io.micrometer.core.instrument.Metrics;
import io.micrometer.core.instrument.Tag;

Expand All @@ -42,54 +43,54 @@ public class MetricsMonitor {
private static AtomicInteger failedPush = new AtomicInteger();

static {
List<Tag> tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "mysqlhealthCheck"));
List<Tag> tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "mysqlhealthCheck"));
Metrics.gauge("nacos_monitor", tags, mysqlHealthCheck);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "httpHealthCheck"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "httpHealthCheck"));
Metrics.gauge("nacos_monitor", tags, httpHealthCheck);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "tcpHealthCheck"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "tcpHealthCheck"));
Metrics.gauge("nacos_monitor", tags, tcpHealthCheck);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "domCount"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "domCount"));
Metrics.gauge("nacos_monitor", tags, domCount);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "ipCount"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "ipCount"));
Metrics.gauge("nacos_monitor", tags, ipCount);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "maxPushCost"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "maxPushCost"));
Metrics.gauge("nacos_monitor", tags, maxPushCost);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "avgPushCost"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "avgPushCost"));
Metrics.gauge("nacos_monitor", tags, avgPushCost);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "leaderStatus"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "leaderStatus"));
Metrics.gauge("nacos_monitor", tags, leaderStatus);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "totalPush"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "totalPush"));
Metrics.gauge("nacos_monitor", tags, totalPush);

tags = new ArrayList<>();
tags.add(Tag.of("module", "naming"));
tags.add(Tag.of("name", "failedPush"));
tags = new ArrayList<Tag>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", "failedPush"));
Metrics.gauge("nacos_monitor", tags, failedPush);
}

Expand Down

0 comments on commit 052901f

Please sign in to comment.