Skip to content

Commit

Permalink
[core] Incorporate CR feedback
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
stfeng2 committed Nov 25, 2015
1 parent d4ff9ec commit 3e3d401
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
22 changes: 8 additions & 14 deletions core/src/main/java/com/yahoo/ycsb/DBWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ public class DBWrapper extends DB
DB _db;
Measurements _measurements;

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

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

String latencyTrackedErrors = getProperties().getProperty(
"latencytrackederrors", null);
if (latencyTrackedErrors != null) {
this.latencyTrackedErrors = new HashSet<String>(Arrays.asList(
latencyTrackedErrors.split(",")));
if (!reportLatencyForEachError) {
String latencyTrackedErrors = getProperties().getProperty(
"latencytrackederrors", null);
if (latencyTrackedErrors != null) {
this.latencyTrackedErrors = new HashSet<String>(Arrays.asList(
latencyTrackedErrors.split(",")));
}
}

System.out.println("DBWrapper: report latency for each error is " +
System.err.println("DBWrapper: report latency for each error is " +
this.reportLatencyForEachError + " and specific error codes to track" +
" for latency are: " + this.latencyTrackedErrors.toString());
}
Expand Down
18 changes: 18 additions & 0 deletions workloads/workload_template
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,21 @@ histogram.buckets=1000

# Granularity for time series (in milliseconds)
timeseries.granularity=1000

# Latency reporting.
#
# YCSB records latency of failed operations separately from successful ones.
# Latency of all OK operations will be reported under their operation name,
# such as [READ], [UPDATE], etc.
#
# For failed operations:
# By default we don't track latency numbers of specific error status.
# We just report latency of all failed operation under one measurement name
# such as [READ-FAILED]. But optionally, user can configure to have either:
# 1. Record and report latency for each and every error status code by
# setting reportLatencyForEachError to true, or
# 2. Record and report latency for a select set of error status codes by
# providing a CSV list of Status codes via the "latencytrackederrors"
# property.
# reportlatencyforeacherror=false
# latencytrackederrors="<comma separated strings of error codes>"

0 comments on commit 3e3d401

Please sign in to comment.