Skip to content

Commit 3e3d401

Browse files
committed
[core] Incorporate CR feedback
- Move the doc (code comment) to workload_template - Minor changes in propery parsing logic and log to System.Err; [core] Incoporate CR comment Missed one comment before.
1 parent d4ff9ec commit 3e3d401

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

core/src/main/java/com/yahoo/ycsb/DBWrapper.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ public class DBWrapper extends DB
3535
DB _db;
3636
Measurements _measurements;
3737

38-
// By default we don't track latency numbers for specific error status code.
39-
// We just report latency of all failed operation under one measurement name
40-
// such as [READ-FAILED]. But optionally, user can configure to have either:
41-
// 1) Record and report latency for each and every error status code by
42-
// setting reportLatencyForEachError to true, or
43-
// 2) Record and report latency for a select set of error status codes by
44-
// providing a CSV list of Status codes via the "latencytrackederrors"
45-
// property.
4638
boolean reportLatencyForEachError = false;
4739
HashSet<String> latencyTrackedErrors = new HashSet<String>();
4840

@@ -79,14 +71,16 @@ public void init() throws DBException
7971
this.reportLatencyForEachError = Boolean.parseBoolean(getProperties().
8072
getProperty("reportlatencyforeacherror", "false"));
8173

82-
String latencyTrackedErrors = getProperties().getProperty(
83-
"latencytrackederrors", null);
84-
if (latencyTrackedErrors != null) {
85-
this.latencyTrackedErrors = new HashSet<String>(Arrays.asList(
86-
latencyTrackedErrors.split(",")));
74+
if (!reportLatencyForEachError) {
75+
String latencyTrackedErrors = getProperties().getProperty(
76+
"latencytrackederrors", null);
77+
if (latencyTrackedErrors != null) {
78+
this.latencyTrackedErrors = new HashSet<String>(Arrays.asList(
79+
latencyTrackedErrors.split(",")));
80+
}
8781
}
8882

89-
System.out.println("DBWrapper: report latency for each error is " +
83+
System.err.println("DBWrapper: report latency for each error is " +
9084
this.reportLatencyForEachError + " and specific error codes to track" +
9185
" for latency are: " + this.latencyTrackedErrors.toString());
9286
}

workloads/workload_template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,21 @@ histogram.buckets=1000
138138

139139
# Granularity for time series (in milliseconds)
140140
timeseries.granularity=1000
141+
142+
# Latency reporting.
143+
#
144+
# YCSB records latency of failed operations separately from successful ones.
145+
# Latency of all OK operations will be reported under their operation name,
146+
# such as [READ], [UPDATE], etc.
147+
#
148+
# For failed operations:
149+
# By default we don't track latency numbers of specific error status.
150+
# We just report latency of all failed operation under one measurement name
151+
# such as [READ-FAILED]. But optionally, user can configure to have either:
152+
# 1. Record and report latency for each and every error status code by
153+
# setting reportLatencyForEachError to true, or
154+
# 2. Record and report latency for a select set of error status codes by
155+
# providing a CSV list of Status codes via the "latencytrackederrors"
156+
# property.
157+
# reportlatencyforeacherror=false
158+
# latencytrackederrors="<comma separated strings of error codes>"

0 commit comments

Comments
 (0)