[clusterfest commit] r229 - in trunk: conf src/com/flaptor/clusterfest/monitoring

0 views
Skip to first unread message

codesite...@google.com

unread,
Jul 15, 2008, 7:26:45 PM7/15/08
to clust...@googlegroups.com
Author: san...@santip.com.ar
Date: Tue Jul 15 16:25:43 2008
New Revision: 229

Modified:
trunk/conf/clustering.properties.defaults
trunk/src/com/flaptor/clusterfest/monitoring/DefaultPropertyFormatter.java
trunk/src/com/flaptor/clusterfest/monitoring/MonitorModule.java

Log:
Added formatting for iterables
Fixed a naming problem in clustering.properties.default and some minor issues

Modified: trunk/conf/clustering.properties.defaults
==============================================================================
--- trunk/conf/clustering.properties.defaults (original)
+++ trunk/conf/clustering.properties.defaults Tue Jul 15 16:25:43 2008
@@ -2,8 +2,8 @@
clustering.modules=

clustering.checkNodesInterval=60
-clustering.monitor.formatter=com.flaptor.clustering.monitoring.DefaultPropertyFormatter
-clustering.monitor.checker=com.flaptor.clustering.monitoring.DefaultChecker
+clustering.monitor.formatter=com.flaptor.clusterfest.monitoring.DefaultPropertyFormatter
+clustering.monitor.checker=com.flaptor.clusterfest.monitoring.DefaultChecker

clustering.monitor.statesDir=states
clustering.monitor.logs.defaults=

Modified: trunk/src/com/flaptor/clusterfest/monitoring/DefaultPropertyFormatter.java
==============================================================================
---
trunk/src/com/flaptor/clusterfest/monitoring/DefaultPropertyFormatter.java (original)
+++
trunk/src/com/flaptor/clusterfest/monitoring/DefaultPropertyFormatter.java
Tue Jul 15 16:25:43 2008
@@ -14,9 +14,24 @@
if (name.equals("freeMemory") || name.equals("totalMemory") ||
name.equals("usedMemory")) {
return bytesToString(((Long)value).longValue());
}
+ if (value instanceof Iterable<?>) {
+ return iterableToString((Iterable<?>)value);
+ }
return StringUtil.whitespaceToHtml(value.toString());
}

+ private String iterableToString(Iterable<?> value) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("<ul>");
+ for (Object v : value) {
+ sb.append("<li>");
+ sb.append(v);
+ sb.append("</li>");
+ }
+ sb.append("</ul>");
+ return sb.toString();
+ }
+
/**
* This method returns a nice representation of longs in the format
* G,M,k,

Modified: trunk/src/com/flaptor/clusterfest/monitoring/MonitorModule.java
==============================================================================
--- trunk/src/com/flaptor/clusterfest/monitoring/MonitorModule.java (original)
+++ trunk/src/com/flaptor/clusterfest/monitoring/MonitorModule.java Tue
Jul 15 16:25:43 2008
@@ -224,9 +224,14 @@

if (monitorNode != null) {
NodeState state = monitorNode.getLastState();
- if (state != null) sanity = state.getSanity().getSanity();
+ if (state != null) {
+ sanity = state.getSanity().getSanity();
+ }
}
- return "<a class=\"sanity"+sanity+"\"
href=\"monitorNode.do?idx=" + nodeNum + "\">"+ sanity +"</a>";
+
+ String sanityHtml = "<a class=\"sanity"+sanity+"\"
href=\"monitorNode.do?idx=" + nodeNum + "\">"+ sanity +"</a>";
+
+ return sanityHtml;
}
public void setup(WebServer server) {
}

Reply all
Reply to author
Forward
0 new messages