Clean the jmxproxy output

This patch clean the redundant output the jmx proxy creates.
It set the trace level of the called method to finest and remove some
println leftovers.

Fixes #22

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
This commit is contained in:
Amnon Heiman 2015-12-30 08:47:32 +02:00 committed by Pekka Enberg
parent 6c2bb34ca3
commit 2eb9f19236
12 changed files with 19 additions and 22 deletions

View File

@ -57,7 +57,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
private static Timer timer = new Timer("Column Family");
public void log(String str) {
logger.info(str);
logger.finest(str);
}
public static void register_mbeans() {

View File

@ -46,7 +46,7 @@ public class CommitLog implements CommitLogMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
private static final CommitLog instance = new CommitLog();

View File

@ -41,7 +41,7 @@ import com.scylladb.jmx.api.APIClient;
/*
* Copyright 2015 Cloudius Systems
*
*
* Modified by Cloudius Systems
*/
public class CompactionManager implements CompactionManagerMBean {
@ -53,7 +53,7 @@ public class CompactionManager implements CompactionManagerMBean {
CompactionMetrics metrics = new CompactionMetrics();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
static {
@ -176,7 +176,7 @@ public class CompactionManager implements CompactionManagerMBean {
/**
* Allows user to resize maximum size of the compaction thread pool.
*
*
* @param number
* New maximum of compaction threads
*/
@ -194,7 +194,7 @@ public class CompactionManager implements CompactionManagerMBean {
/**
* Allows user to resize maximum size of the compaction thread pool.
*
*
* @param number
* New maximum of compaction threads
*/
@ -212,7 +212,7 @@ public class CompactionManager implements CompactionManagerMBean {
/**
* Allows user to resize maximum size of the compaction thread pool.
*
*
* @param number
* New maximum of compaction threads
*/
@ -230,7 +230,7 @@ public class CompactionManager implements CompactionManagerMBean {
/**
* Allows user to resize maximum size of the validator thread pool.
*
*
* @param number
* New maximum of validator threads
*/

View File

@ -43,7 +43,7 @@ public class FailureDetector implements FailureDetectorMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
private static final FailureDetector instance = new FailureDetector();

View File

@ -57,7 +57,7 @@ public class Gossiper implements GossiperMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
private static final Gossiper instance = new Gossiper();

View File

@ -35,7 +35,7 @@ public class EndpointSnitchInfo implements EndpointSnitchInfoMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
private static final EndpointSnitchInfo instance = new EndpointSnitchInfo();

View File

@ -97,8 +97,7 @@ public final class MessagingService implements MessagingServiceMBean {
}
public void log(String str) {
System.out.println(str);
logger.info(str);
logger.finest(str);
}
private static Timer timer = new Timer("Dropped messages");
@ -131,7 +130,6 @@ public final class MessagingService implements MessagingServiceMBean {
for (String k : val.keySet()) {
APISettableMeter meter = instance.dropped.get(k).getMeter();
meter.set(val.get(k));
System.out.println("tick " + k + " " + meter.count());
meter.tick();
}
}
@ -153,7 +151,7 @@ public final class MessagingService implements MessagingServiceMBean {
* Completed tasks for Command(Mutations, Read etc) TCP Connections
*/
public Map<String, Long> getCommandCompletedTasks() {
System.out.println("getCommandCompletedTasks!");
log("getCommandCompletedTasks()");
Map<String, Long> res = c
.getListMapStringLongValue("/messaging_service/messages/sent");
return res;

View File

@ -42,7 +42,7 @@ public class CacheService implements CacheServiceMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
public static final String MBEAN_NAME = "org.apache.cassandra.db:type=Caches";

View File

@ -254,7 +254,7 @@ public class GCInspector implements NotificationListener, GCInspectorMXBean
String st = sb.toString();
if (duration > MIN_LOG_DURATION)
logger.info(st);
logger.trace(st);
else if (logger.isDebugEnabled())
logger.debug(st);
}

View File

@ -43,7 +43,7 @@ public class StorageProxy implements StorageProxyMBean {
private APIClient c = new APIClient();
public void log(String str) {
logger.info(str);
logger.finest(str);
}
private static final StorageProxy instance = new StorageProxy();

View File

@ -93,8 +93,7 @@ public class StorageService extends NotificationBroadcasterSupport
}
public void log(String str) {
System.out.println(str);
logger.info(str);
logger.finest(str);
}
/**
@ -638,7 +637,7 @@ public class StorageService extends NotificationBroadcasterSupport
* @param repair
*/
public int waitAndNotifyRepair(int cmd, String keyspace, String message) {
logger.info(message);
logger.finest(message);
sendNotification("repair", message, new int[]{cmd, RepairStatus.STARTED.ordinal()});
TimerTask taskToExecute = new CheckRepair(cmd, keyspace);
timer.schedule(taskToExecute, 100, 1000);

View File

@ -69,7 +69,7 @@ public class StreamManager implements StreamManagerMBean {
return instance;
}
public Set<CompositeData> getCurrentStreams() {
logger.info("getCurrentStreams");
logger.finest("getCurrentStreams");
return Sets.newHashSet(Iterables.transform(getState(), new Function<StreamState, CompositeData>()
{
public CompositeData apply(StreamState input)