@@ -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 }
0 commit comments