From 9fd0bb071dfc02a29b05351d7af9741fb3440831 Mon Sep 17 00:00:00 2001 From: David Hentchel Date: Wed, 3 Apr 2013 12:04:05 -0400 Subject: [PATCH] Converted operation count and record count to long --- core/src/main/java/com/yahoo/ycsb/Client.java | 22 +++++++++---------- .../statusreporter/HttpStatusReporter.java | 2 +- .../ycsb/statusreporter/StatusReporter.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/com/yahoo/ycsb/Client.java b/core/src/main/java/com/yahoo/ycsb/Client.java index 98cbbcfec6..a7719e29b7 100644 --- a/core/src/main/java/com/yahoo/ycsb/Client.java +++ b/core/src/main/java/com/yahoo/ycsb/Client.java @@ -95,7 +95,7 @@ public void run() { alldone=true; - int totalops=0; + long totalops=0; //terminate this thread when all the worker threads are done for (Thread t : _threads) @@ -177,10 +177,10 @@ class ClientThread extends Thread DB _db; boolean _dotransactions; Workload _workload; - int _opcount; + long _opcount; double _target; - int _opsdone; + long _opsdone; int _threadid; int _threadcount; Object _workloadstate; @@ -199,7 +199,7 @@ class ClientThread extends Thread * @param opcount the number of operations (transactions or inserts) to do * @param targetperthreadperms target number of operations per thread per ms */ - public ClientThread(DB db, boolean dotransactions, Workload workload, int threadid, int threadcount, Properties props, int opcount, double targetperthreadperms) + public ClientThread(DB db, boolean dotransactions, Workload workload, int threadid, int threadcount, Properties props, long opcount, double targetperthreadperms) { //TODO: consider removing threadcount and threadid _db=db; @@ -214,7 +214,7 @@ public ClientThread(DB db, boolean dotransactions, Workload workload, int thread //System.out.println("Interval = "+interval); } - public int getOpsDone() + public long getOpsDone() { return _opsdone; } @@ -421,7 +421,7 @@ public static boolean checkRequiredProperties(Properties props) * loaded from conf. * @throws IOException Either failed to write to output stream or failed to close it. */ - private static void exportMeasurements(Properties props, int opcount, long runtime) + private static void exportMeasurements(Properties props, long opcount, long runtime) throws IOException { MeasurementsExporter exporter = null; @@ -723,20 +723,20 @@ public void run() System.err.println("Starting test..."); - int opcount; + long opcount; if (dotransactions) { - opcount=Integer.parseInt(props.getProperty(OPERATION_COUNT_PROPERTY,"0")); + opcount=Long.parseLong(props.getProperty(OPERATION_COUNT_PROPERTY,"0")); } else { if (props.containsKey(INSERT_COUNT_PROPERTY)) { - opcount=Integer.parseInt(props.getProperty(INSERT_COUNT_PROPERTY,"0")); + opcount=Long.parseLong(props.getProperty(INSERT_COUNT_PROPERTY,"0")); } else { - opcount=Integer.parseInt(props.getProperty(RECORD_COUNT_PROPERTY,"0")); + opcount=Long.parseLong(props.getProperty(RECORD_COUNT_PROPERTY,"0")); } } @@ -788,7 +788,7 @@ public void run() terminator.start(); } - int opsDone = 0; + long opsDone = 0; for (Thread t : threads) { diff --git a/core/src/main/java/com/yahoo/ycsb/statusreporter/HttpStatusReporter.java b/core/src/main/java/com/yahoo/ycsb/statusreporter/HttpStatusReporter.java index c2d5474e46..de4eab1385 100644 --- a/core/src/main/java/com/yahoo/ycsb/statusreporter/HttpStatusReporter.java +++ b/core/src/main/java/com/yahoo/ycsb/statusreporter/HttpStatusReporter.java @@ -34,7 +34,7 @@ public boolean configure(Properties props) { * Where parms always include client, interval, totalops and tps; * and may include latency measures for read, update, insert, delete or scan. */ - public void report(long interval, int totalops, double curthroughput, String measures) { + public void report(long interval, long totalops, double curthroughput, String measures) { String urlParameters = "client=" + _clientid + "&interval=" + interval + "&totalops=" + totalops + "&tps=" + curthroughput; String[] parts = Pattern.compile("]|\\[").split(measures.trim()); diff --git a/core/src/main/java/com/yahoo/ycsb/statusreporter/StatusReporter.java b/core/src/main/java/com/yahoo/ycsb/statusreporter/StatusReporter.java index 76db4c3dba..2ed5d5958a 100644 --- a/core/src/main/java/com/yahoo/ycsb/statusreporter/StatusReporter.java +++ b/core/src/main/java/com/yahoo/ycsb/statusreporter/StatusReporter.java @@ -16,7 +16,7 @@ public interface StatusReporter * @param measurements - output from Measurements.getMeasurements().getSummary() method; includes latency for any YCSB operations * (read, update, insert, delete, scan) that occur in this interval */ - void report(long interval, int totalops, double curthroughput, String measurements); + void report(long interval, long totalops, double curthroughput, String measurements); /** * Clean up any resources and connections used by the reporter.