Skip to content
Permalink
Browse files
[JENKINS-22791] removed unused parameter and redundant line
  • Loading branch information
escoem committed Oct 23, 2017
1 parent 42fae57 commit 256310135ad3ecd237f0ce2ccf82a84e84f4473a
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/main/java/com/cloudbees/jenkins/support/impl/HeapUsageHistogram.java
@@ -58,21 +58,20 @@ public void addContents(@NonNull Container result) {
new Content("nodes/master/heap-histogram.txt") {
@Override
public void writeTo(OutputStream os) throws IOException {
os.write(getLiveHistogram(Jenkins.getInstance()).getBytes("UTF-8"));
os.write(getLiveHistogram().getBytes("UTF-8"));
}
}
);
}

private String getLiveHistogram(Node node) throws IOException {
private String getLiveHistogram() throws IOException {
final String raw = getRawLiveHistogram();
final String[] lines = raw.split("\n");
final int limit = MAX <= lines.length ? MAX : lines.length;

final StringBuilder bos = new StringBuilder();

bos.append("Master Heap Histogram");
for (int i=0; i<limit; i++) {
//starting in 1 because of an empty line
for (int i=1; i<limit; i++) {
bos.append(lines[i]).append('\n');
}

0 comments on commit 2563101

Please sign in to comment.