Skip to content

Commit

Permalink
Converted operation count and record count to long
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hentchel committed Apr 3, 2013
1 parent bf0fcf0 commit 9fd0bb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions core/src/main/java/com/yahoo/ycsb/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
}
}

Expand Down Expand Up @@ -788,7 +788,7 @@ public void run()
terminator.start();
}

int opsDone = 0;
long opsDone = 0;

for (Thread t : threads)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9fd0bb0

Please sign in to comment.