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
1d37be1f
Commit
1d37be1f
authored
8 years ago
by
jschmieg
Committed by
Kevin Risden
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[core] Support for configurable fractional percentile metrics in output file printout (#863)
parent
1b8ebe4b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java
+21
-13
21 additions, 13 deletions
...m/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java
with
21 additions
and
13 deletions
core/src/main/java/com/yahoo/ycsb/measurements/OneMeasurementHdrHistogram.java
+
21
−
13
View file @
1d37be1f
...
...
@@ -58,7 +58,7 @@ public class OneMeasurementHdrHistogram extends OneMeasurement {
*/
public
static
final
String
PERCENTILES_PROPERTY_DEFAULT
=
"95,99"
;
List
<
Integer
>
percentiles
;
List
<
Double
>
percentiles
;
public
OneMeasurementHdrHistogram
(
String
name
,
Properties
props
)
{
super
(
name
);
...
...
@@ -114,7 +114,7 @@ public class OneMeasurementHdrHistogram extends OneMeasurement {
exporter
.
write
(
getName
(),
"MinLatency(us)"
,
totalHistogram
.
getMinValue
());
exporter
.
write
(
getName
(),
"MaxLatency(us)"
,
totalHistogram
.
getMaxValue
());
for
(
Integer
percentile:
percentiles
)
{
for
(
Double
percentile:
percentiles
)
{
exporter
.
write
(
getName
(),
ordinal
(
percentile
)
+
"PercentileLatency(us)"
,
totalHistogram
.
getValueAtPercentile
(
percentile
));
}
...
...
@@ -162,12 +162,12 @@ public class OneMeasurementHdrHistogram extends OneMeasurement {
* @param percentileString - comma delimited string of Integer values
* @return An Integer List of percentile values
*/
private
List
<
Integer
>
getPercentileValues
(
String
percentileString
)
{
List
<
Integer
>
percentileValues
=
new
ArrayList
<
Integer
>();
private
List
<
Double
>
getPercentileValues
(
String
percentileString
)
{
List
<
Double
>
percentileValues
=
new
ArrayList
<
Double
>();
try
{
for
(
String
rawPercentile:
percentileString
.
split
(
","
))
{
percentileValues
.
add
(
Integer
.
parseInt
(
rawPercentile
));
percentileValues
.
add
(
Double
.
parseDouble
(
rawPercentile
));
}
}
catch
(
Exception
e
)
{
// If the given hdrhistogram.percentiles value is unreadable for whatever reason,
...
...
@@ -186,15 +186,23 @@ public class OneMeasurementHdrHistogram extends OneMeasurement {
* @param i
* @return ordinal string
*/
private
String
ordinal
(
int
i
)
{
private
String
ordinal
(
Double
i
)
{
String
[]
suffixes
=
new
String
[]
{
"th"
,
"st"
,
"nd"
,
"rd"
,
"th"
,
"th"
,
"th"
,
"th"
,
"th"
,
"th"
};
switch
(
i
%
100
)
{
case
11
:
case
12
:
case
13
:
return
i
+
"th"
;
default
:
return
i
+
suffixes
[
i
%
10
];
Integer
j
=
i
.
intValue
();
if
(
i
%
1
==
0
)
{
switch
(
j
%
100
)
{
case
11
:
case
12
:
case
13
:
return
j
+
"th"
;
default
:
return
j
+
suffixes
[
j
%
10
];
}
}
else
{
return
i
.
toString
();
}
}
}
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