mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
enhance console reporter
This commit is contained in:
parent
725a9b5d88
commit
16e3e587aa
@ -413,6 +413,11 @@ public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
|
||||
),
|
||||
sessionName
|
||||
);
|
||||
// TODO: Decide whether this should be part of ctor consistency
|
||||
Map.of(
|
||||
"summary", options.getReportSummaryTo(),
|
||||
"logsdir", options.getLogsDirectory().toString()
|
||||
).forEach(session::setComponentProp);
|
||||
|
||||
options.wantsReportCsvTo().ifPresent(cfg -> {
|
||||
MetricInstanceFilter filter = new MetricInstanceFilter();
|
||||
@ -439,7 +444,8 @@ public class NBCLI implements Function<String[], Integer>, NBLabeledElement {
|
||||
|
||||
|
||||
ExecutionResult sessionResult = session.apply(options.getCommands());
|
||||
sessionResult.printSummary(System.out);
|
||||
// sessionResult.printSummary(System.out);
|
||||
logger.info(sessionResult);
|
||||
return sessionResult.getStatus().code;
|
||||
|
||||
}
|
||||
|
@ -41,9 +41,10 @@ public class ConsoleReporter extends PeriodicTaskComponent {
|
||||
private final long rateFactor;
|
||||
private final String durationUnit = TimeUnit.NANOSECONDS.toString().toLowerCase(Locale.US);
|
||||
private final long durationFactor = TimeUnit.NANOSECONDS.toNanos(1);
|
||||
|
||||
public ConsoleReporter(NBComponent node, NBLabels extraLabels, long millis, boolean oneLastTime,
|
||||
PrintStream output, Set<MetricAttribute> disabledMetricAttributes) {
|
||||
super(node, extraLabels, millis, oneLastTime,"REPORT-CONSOLE");
|
||||
super(node, extraLabels, millis, oneLastTime, "REPORT-CONSOLE");
|
||||
this.output = output;
|
||||
this.dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
|
||||
DateFormat.MEDIUM,
|
||||
@ -190,8 +191,10 @@ public class ConsoleReporter extends PeriodicTaskComponent {
|
||||
/**
|
||||
* Print only if the attribute is enabled
|
||||
*
|
||||
* @param type Metric attribute
|
||||
* @param status Status to be logged
|
||||
* @param type
|
||||
* Metric attribute
|
||||
* @param status
|
||||
* Status to be logged
|
||||
*/
|
||||
private void printIfEnabled(MetricAttribute type, String status) {
|
||||
if (getDisabledMetricAttributes().contains(type)) {
|
||||
@ -242,4 +245,9 @@ public class ConsoleReporter extends PeriodicTaskComponent {
|
||||
}
|
||||
report(gauges, counters, histograms, meters, timers);
|
||||
}
|
||||
|
||||
public void reportCountsOnce(List<NBMetric> summaryMetrics) {
|
||||
// TODO: implement counts only renderer
|
||||
// TODO: resolve ambiguity around reporting counts only or reporting nothing for short sessions
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user