Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
YCSB
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adnan Ahmad
YCSB
Commits
0b024834
Commit
0b024834
authored
10 years ago
by
nitsanw
Committed by
Sean Busbey
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[core, client] Fix record count property default value in CoreWorkload, also refactor
throttle method in client.
parent
dfd79c80
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/java/com/yahoo/ycsb/Client.java
+32
-44
32 additions, 44 deletions
core/src/main/java/com/yahoo/ycsb/Client.java
core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java
+1
-1
1 addition, 1 deletion
.../src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java
with
33 additions
and
45 deletions
core/src/main/java/com/yahoo/ycsb/Client.java
+
32
−
44
View file @
0b024834
...
...
@@ -18,10 +18,6 @@
package
com.yahoo.ycsb
;
import
com.yahoo.ycsb.measurements.Measurements
;
import
com.yahoo.ycsb.measurements.exporter.MeasurementsExporter
;
import
com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
...
...
@@ -33,6 +29,10 @@ import java.util.Enumeration;
import
java.util.Properties
;
import
java.util.Vector
;
import
com.yahoo.ycsb.measurements.Measurements
;
import
com.yahoo.ycsb.measurements.exporter.MeasurementsExporter
;
import
com.yahoo.ycsb.measurements.exporter.TextMeasurementsExporter
;
//import org.apache.log4j.BasicConfigurator;
/**
...
...
@@ -240,26 +240,7 @@ class ClientThread extends Thread
_opsdone
++;
//throttle the operations
if
(
_target
>
0
)
{
//this is more accurate than other throttling approaches we have tried,
//like sleeping for (1/target throughput)-operation latency,
//because it smooths timing inaccuracies (from sleep() taking an int,
//current time in millis) over many operations
while
(
System
.
currentTimeMillis
()-
st
<((
double
)
_opsdone
)/
_target
)
{
try
{
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
// do nothing.
}
}
}
throttle
(
st
);
}
}
else
...
...
@@ -276,25 +257,7 @@ class ClientThread extends Thread
_opsdone
++;
//throttle the operations
if
(
_target
>
0
)
{
//this is more accurate than other throttling approaches we have tried,
//like sleeping for (1/target throughput)-operation latency,
//because it smooths timing inaccuracies (from sleep() taking an int,
//current time in millis) over many operations
while
(
System
.
currentTimeMillis
()-
st
<((
double
)
_opsdone
)/
_target
)
{
try
{
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
// do nothing.
}
}
}
throttle
(
st
);
}
}
}
...
...
@@ -316,6 +279,29 @@ class ClientThread extends Thread
return
;
}
}
private
void
throttle
(
long
currTimeMillis
)
{
//throttle the operations
if
(
_target
>
0
)
{
//this is more accurate than other throttling approaches we have tried,
//like sleeping for (1/target throughput)-operation latency,
//because it smooths timing inaccuracies (from sleep() taking an int,
//current time in millis) over many operations
while
(
System
.
currentTimeMillis
()-
currTimeMillis
<((
double
)
_opsdone
)/
_target
)
{
try
{
sleep
(
1
);
}
catch
(
InterruptedException
e
)
{
// do nothing.
}
}
}
}
}
/**
...
...
@@ -324,6 +310,8 @@ class ClientThread extends Thread
public
class
Client
{
public
static
final
String
DEFAULT_RECORD_COUNT
=
"0"
;
/**
* The target number of operations to perform.
*/
...
...
@@ -738,7 +726,7 @@ public class Client
}
else
{
opcount
=
Integer
.
parseInt
(
props
.
getProperty
(
RECORD_COUNT_PROPERTY
,
"0"
));
opcount
=
Integer
.
parseInt
(
props
.
getProperty
(
RECORD_COUNT_PROPERTY
,
DEFAULT_RECORD_COUNT
));
}
}
...
...
This diff is collapsed.
Click to expand it.
core/src/main/java/com/yahoo/ycsb/workloads/CoreWorkload.java
+
1
−
1
View file @
0b024834
...
...
@@ -349,7 +349,7 @@ public class CoreWorkload extends Workload
double
insertproportion
=
Double
.
parseDouble
(
p
.
getProperty
(
INSERT_PROPORTION_PROPERTY
,
INSERT_PROPORTION_PROPERTY_DEFAULT
));
double
scanproportion
=
Double
.
parseDouble
(
p
.
getProperty
(
SCAN_PROPORTION_PROPERTY
,
SCAN_PROPORTION_PROPERTY_DEFAULT
));
double
readmodifywriteproportion
=
Double
.
parseDouble
(
p
.
getProperty
(
READMODIFYWRITE_PROPORTION_PROPERTY
,
READMODIFYWRITE_PROPORTION_PROPERTY_DEFAULT
));
recordcount
=
Integer
.
parseInt
(
p
.
getProperty
(
Client
.
RECORD_COUNT_PROPERTY
));
recordcount
=
Integer
.
parseInt
(
p
.
getProperty
(
Client
.
RECORD_COUNT_PROPERTY
,
Client
.
DEFAULT_RECORD_COUNT
));
String
requestdistrib
=
p
.
getProperty
(
REQUEST_DISTRIBUTION_PROPERTY
,
REQUEST_DISTRIBUTION_PROPERTY_DEFAULT
);
int
maxscanlength
=
Integer
.
parseInt
(
p
.
getProperty
(
MAX_SCAN_LENGTH_PROPERTY
,
MAX_SCAN_LENGTH_PROPERTY_DEFAULT
));
String
scanlengthdistrib
=
p
.
getProperty
(
SCAN_LENGTH_DISTRIBUTION_PROPERTY
,
SCAN_LENGTH_DISTRIBUTION_PROPERTY_DEFAULT
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment