ru.fix.aggregating.profiler.ProfilerReport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aggregating-profiler Show documentation
Show all versions of aggregating-profiler Show documentation
https://github.com/ru-fix/aggregating-profiler
package ru.fix.aggregating.profiler;
import java.util.List;
import java.util.Map;
public class ProfilerReport {
private final Map indicators;
private final List profilerCallReports;
public ProfilerReport(Map indicators, List profilerCallReports) {
this.indicators = indicators;
this.profilerCallReports = profilerCallReports;
}
public Map getIndicators() {
return indicators;
}
public List getProfilerCallReports() {
return profilerCallReports;
}
@Override
public String toString() {
StringBuilder sumReport = new StringBuilder();
sumReport.append("Indicators:\n");
indicators.forEach((key, value) ->
sumReport.append(key)
.append(" = ")
.append(value)
.append('\n')
);
sumReport.append("Profilers:\n");
profilerCallReports.forEach(pr ->
sumReport.append(pr.toString())
.append('\n')
);
return sumReport.toString();
}
}