Permalink
Browse files

layout change for kryo2 reports

  • Loading branch information...
1 parent 0f6932c commit 2336f01522589242430656a2f1a4167eb996dac8 @michaelmosmann michaelmosmann committed Jun 26, 2013
@@ -44,27 +44,27 @@
.build());
static final Column id = new Column("#",
new AttributeBuilder().set(Column.Align.Right).set(Column.FillBefore, ' ')
- .set(Column.Separator, "|")
+ .set(Column.Separator, "| ")
.build());
static final Column label = new Column("Type",
- new AttributeBuilder().set(Column.FillAfter, '.')
- .set(Column.Separator, "...")
+ new AttributeBuilder().set(Column.FillAfter, ' ')
+ .set(Column.Separator, "|")
.set(Column.Indent, " ")
.build());
static final Column percent = new Column("", new AttributeBuilder().set(Column.Align.Right)
- .set(Column.FillBefore, '.')
- .set(Column.Separator, "%|.")
+ .set(Column.FillBefore, ' ')
+ .set(Column.Separator, "%| ")
.build());
static final Column sum = new Column("sum", new AttributeBuilder().set(Column.Align.Right)
- .set(Column.FillBefore, '.')
- .set(Column.Separator, "|.")
+ .set(Column.FillBefore, ' ')
+ .set(Column.Separator, "| ")
.build());
static final Column local = new Column("local", new AttributeBuilder().set(Column.Align.Right)
- .set(Column.FillBefore, '.')
- .set(Column.Separator, "|.")
+ .set(Column.FillBefore, ' ')
+ .set(Column.Separator, "| ")
.build());
static final Column child = new Column("child", new AttributeBuilder().set(Column.Align.Right)
- .set(Column.FillBefore, '.')
+ .set(Column.FillBefore, ' ')
.set(Column.Separator, "|")
.build());
@@ -86,8 +86,8 @@ public String render(ISerializedObjectTree tree) {
Report report = new Report("TreeSizeReport\n");
process(tree, report, 0, tree.size() + tree.childSize());
String result = report
- .export(emptyFirst, id, label, percent, sum, local,
- child).separateColumnNamesWith('-')
+ .export(emptyFirst, id, percent, sum, local,
+ child, label).separateColumnNamesWith('-')
.tableBorderWith('=').asString();
return result;
@@ -53,11 +53,11 @@
.set(Column.Separator, "|")
.build());
static final Column label = new Column("Type",
- new AttributeBuilder().set(Column.FillAfter, '.')
- .set(Column.Separator, "...")
+ new AttributeBuilder().set(Column.FillAfter, ' ')
+ .set(Column.Separator, "|")
.build());
static final Column size = new Column("bytes", new AttributeBuilder().set(Column.Align.Right)
- .set(Column.FillBefore, '.')
+ .set(Column.FillBefore, ' ')
.set(Column.Separator, "|")
.build());
@@ -95,7 +95,7 @@ public int compare(Entry<Class<?>, Counter> o1,
report.newRow().set(label, 0, e.getKey().getName())
.set(size, 0, "" + e.getValue().size);
}
- String result = report.export(emptyFirst, label, size)
+ String result = report.export(emptyFirst, size, label)
.separateColumnNamesWith('-').tableBorderWith('=')
.asString();
@@ -251,11 +251,21 @@ private void fill(StringBuilder sb, int count, String s)
private void fill(StringBuilder sb, int count, char c)
{
- for (int i = 0; i < count; i++)
+ if (count<10) {
+ for (int i = 0; i < count; i++)
+ {
+ sb.append(c);
+ }
+ }
+ else
{
- sb.append(c);
+ char[] buffer=new char[count];
+ for (int i = 0; i< count; i++)
+ {
+ buffer[i]=c;
+ }
+ sb.append(buffer);
}
-
}

0 comments on commit 2336f01

Please sign in to comment.