Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTime-Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Tavares de Sousa
TeeTime-Framework
Commits
16f4f4c7
Commit
16f4f4c7
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
prepared a performance test suite
parent
66fd725d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/teetime/util/StatisticsUtil.java
+14
-1
14 additions, 1 deletion
src/main/java/teetime/util/StatisticsUtil.java
src/test/java/test/PerformanceResult.java
+7
-0
7 additions, 0 deletions
src/test/java/test/PerformanceResult.java
with
21 additions
and
1 deletion
src/main/java/teetime/util/StatisticsUtil.java
+
14
−
1
View file @
16f4f4c7
...
...
@@ -24,6 +24,7 @@ import java.util.Map.Entry;
import
java.util.concurrent.TimeUnit
;
import
teetime.variant.explicitScheduling.examples.throughput.TimestampObject
;
import
test.PerformanceResult
;
/**
* @author Christian Wulf
...
...
@@ -43,7 +44,9 @@ public class StatisticsUtil {
}
public
static
void
printStatistics
(
final
long
overallDurationInNs
,
final
List
<
TimestampObject
>
timestampObjects
)
{
public
static
PerformanceResult
printStatistics
(
final
long
overallDurationInNs
,
final
List
<
TimestampObject
>
timestampObjects
)
{
PerformanceResult
performanceResult
=
new
PerformanceResult
();
System
.
out
.
println
(
"Duration: "
+
TimeUnit
.
NANOSECONDS
.
toMillis
(
overallDurationInNs
)
+
" ms"
);
final
List
<
Long
>
sortedDurationsInNs
=
new
ArrayList
<
Long
>(
timestampObjects
.
size
()
/
2
);
...
...
@@ -56,18 +59,28 @@ public class StatisticsUtil {
sumInNs
+=
durationInNs
;
}
performanceResult
.
sumInNs
=
sumInNs
;
final
Map
<
Double
,
Long
>
quintileValues
=
StatisticsUtil
.
calculateQuintiles
(
sortedDurationsInNs
);
performanceResult
.
quantiles
=
quintileValues
;
final
long
avgDurInNs
=
sumInNs
/
(
timestampObjects
.
size
()
/
2
);
System
.
out
.
println
(
"avg duration: "
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
avgDurInNs
)
+
" µs"
);
performanceResult
.
avgDurInNs
=
avgDurInNs
;
printQuintiles
(
quintileValues
);
final
long
confidenceWidthInNs
=
StatisticsUtil
.
calculateConfidenceWidth
(
sortedDurationsInNs
,
avgDurInNs
);
performanceResult
.
confidenceWidthInNs
=
confidenceWidthInNs
;
System
.
out
.
println
(
"confidenceWidth: "
+
confidenceWidthInNs
+
" ns"
);
System
.
out
.
println
(
"["
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
avgDurInNs
-
confidenceWidthInNs
)
+
" µs, "
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
avgDurInNs
+
confidenceWidthInNs
)
+
" µs]"
);
return
performanceResult
;
}
public
static
void
printQuintiles
(
final
Map
<
Double
,
Long
>
quintileValues
)
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/test/PerformanceResult.java
+
7
−
0
View file @
16f4f4c7
package
test
;
import
java.util.Map
;
public
class
PerformanceResult
{
public
long
sumInNs
;
public
Map
<
Double
,
Long
>
quantiles
;
public
long
avgDurInNs
;
public
long
confidenceWidthInNs
;
}
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