Skip to content

Commit

Permalink
some code optimization for ClassGenerator.java and DubboMonitor.java (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
ZZMarquis authored Mar 26, 2020
1 parent 70f7216 commit 7dbe632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ private static String modifier(int mod) {
StringBuilder modifier = new StringBuilder();
if (Modifier.isPublic(mod)) {
modifier.append("public");
}
if (Modifier.isProtected(mod)) {
} else if (Modifier.isProtected(mod)) {
modifier.append("protected");
}
if (Modifier.isPrivate(mod)) {
} else if (Modifier.isPrivate(mod)) {
modifier.append("private");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ public class DubboMonitor implements Monitor {

private final MonitorService monitorService;

/**
* The time interval for timer <b>scheduledExecutorService</b> to send data
*/
private final long monitorInterval;

private final ConcurrentMap<Statistics, AtomicReference<long[]>> statisticsMap = new ConcurrentHashMap<Statistics, AtomicReference<long[]>>();

public DubboMonitor(Invoker<MonitorService> monitorInvoker, MonitorService monitorService) {
this.monitorInvoker = monitorInvoker;
this.monitorService = monitorService;
this.monitorInterval = monitorInvoker.getUrl().getPositiveParameter("interval", 60000);
// The time interval for timer <b>scheduledExecutorService</b> to send data
final long monitorInterval = monitorInvoker.getUrl().getPositiveParameter("interval", 60000);
// collect timer for collecting statistics data
sendFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
try {
Expand Down

0 comments on commit 7dbe632

Please sign in to comment.