perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5963 - in trunk: perfsonar-java-base2/src/main/java/org/perfson ar/base2/xml perfsonar-java-rrd-ma-SQL_backend/src/main/ java/org/perfsonar/service/measurementArchive/rrdType
Subject: perfsonar development work
List archive
[pS-dev] [GEANT/SA2/ps-java-services] r5963 - in trunk: perfsonar-java-base2/src/main/java/org/perfson ar/base2/xml perfsonar-java-rrd-ma-SQL_backend/src/main/ java/org/perfsonar/service/measurementArchive/rrdType
Chronological Thread
- From:
- To:
- Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5963 - in trunk: perfsonar-java-base2/src/main/java/org/perfson ar/base2/xml perfsonar-java-rrd-ma-SQL_backend/src/main/ java/org/perfsonar/service/measurementArchive/rrdType
- Date: Mon, 20 Aug 2012 10:26:49 +0100 (BST)
Author: nordunet.behrmann
Date: 2012-08-20 10:26:49 +0100 (Mon, 20 Aug 2012)
New Revision: 5963
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
Log:
Reduce logging overhead of large Message objects
Modified:
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
===================================================================
---
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
2012-08-17 11:49:06 UTC (rev 5962)
+++
trunk/perfsonar-java-base2/src/main/java/org/perfsonar/base2/xml/Element.java
2012-08-20 09:26:49 UTC (rev 5963)
@@ -254,52 +254,35 @@
@Override
- public String toString() {
-
- StringBuffer sb = new StringBuffer("");
- getDeeper(this, sb, 0);
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ getDeeper(this, sb, "");
sb.append("\n");
return sb.toString();
}
- private StringBuffer getDeeper(Element parent, StringBuffer sb, int
level) {
+ private StringBuilder getDeeper(Element parent, StringBuilder sb, String
indent)
+ {
+
sb.append("\n").append(indent).append("name=").append(parent.getName());
+
sb.append("\n").append(indent).append("class=").append(parent.getClass());
+
sb.append("\n").append(indent).append("nsContext=").append(parent.getNamespaceUri());
+
sb.append("\n").append(indent).append("nsPrefix=").append(parent.getNamespacePrefix());
+
sb.append("\n").append(indent).append("nsUri=").append(parent.getNamespaceUri());
+ sb.append("\n").append(indent).append("attributes:");
- String indent = new String("");
- for(int i=0; i<level; i++) indent += " ";
-
- sb.append("\n" + indent + "name=");
- sb.append(parent.getName());
- sb.append("\n" + indent + "class=");
- sb.append(parent.getClass());
- sb.append("\n" + indent + "nsContext=");
- sb.append(parent.getNamespaceUri());
- sb.append("\n" + indent + "nsPrefix=");
- sb.append(parent.getNamespacePrefix());
- sb.append("\n" + indent + "nsUri=");
- sb.append(parent.getNamespaceUri());
- sb.append("\n" + indent + "attributes:");
-
// attributes
- Iterator<Map.Entry<String, String>> i =
parent.getAttributes().entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry<String,String> attr = i.next();
- String name1 = (String) attr.getKey();
- String value1 = (String) attr.getValue();
- sb.append("\n " + indent + "" +name1 + "=");
- sb.append(value1);
+ for (Map.Entry<String, String> attr :
parent.getAttributes().entrySet()) {
+ sb.append("\n
").append(indent).append("").append(attr.getKey()).append("=").append(attr.getValue());
}
- sb.append("\n" + indent + "value=");
- sb.append(parent.getText());
+
sb.append("\n").append(indent).append("value=").append(parent.getText());
+ sb.append("\n").append(indent).append("-----------");
- sb.append("\n" + indent + "-----------");
-
-
- Collection<Element> _children = parent.getChildren();
- level += 1;
- for (Element _ch : _children)
- getDeeper(_ch, sb, level);
-
+ indent += " ";
+ for (Element _ch : parent.getChildren()) {
+ getDeeper(_ch, sb, indent);
+ }
return sb;
}
Modified:
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
===================================================================
---
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
2012-08-17 11:49:06 UTC (rev 5962)
+++
trunk/perfsonar-java-rrd-ma-SQL_backend/src/main/java/org/perfsonar/service/measurementArchive/rrdType/SetupDataServiceEngine.java
2012-08-20 09:26:49 UTC (rev 5963)
@@ -104,7 +104,7 @@
logger.debug("ResponseToString");
- logger.debug(response.toString());
+ logger.debug(response);
serviceResponse.setElement(response);
}
- [pS-dev] [GEANT/SA2/ps-java-services] r5963 - in trunk: perfsonar-java-base2/src/main/java/org/perfson ar/base2/xml perfsonar-java-rrd-ma-SQL_backend/src/main/ java/org/perfsonar/service/measurementArchive/rrdType, svn-noreply, 08/20/2012
Archive powered by MHonArc 2.6.16.