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
9324dcce
Commit
9324dcce
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
added BucketTimingsReader
parent
efaec3c0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conf/logback.groovy
+2
-1
2 additions, 1 deletion
conf/logback.groovy
src/main/java/util/BucketTimingsReader.java
+56
-0
56 additions, 0 deletions
src/main/java/util/BucketTimingsReader.java
submodules/JCTools
+1
-1
1 addition, 1 deletion
submodules/JCTools
with
59 additions
and
2 deletions
conf/logback.groovy
+
2
−
1
View file @
9324dcce
...
...
@@ -26,4 +26,5 @@ logger "teetime.variant.methodcallWithPorts.stage", INFO
logger
"teetime.variant.methodcallWithPorts.framework.core.pipe"
,
INFO
logger
"util.TimingsReader"
,
TRACE
,
[
"FILE"
]
\ No newline at end of file
logger
"util.TimingsReader"
,
TRACE
,
[
"FILE"
]
logger
"util.BucketTimingsReader"
,
TRACE
,
[
"FILE"
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main/java/util/BucketTimingsReader.java
0 → 100644
+
56
−
0
View file @
9324dcce
package
util
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Map
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.google.common.base.Charsets
;
import
com.google.common.io.CharSource
;
import
com.google.common.io.Files
;
public
class
BucketTimingsReader
{
private
final
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
BucketTimingsReader
.
class
);
public
static
void
main
(
final
String
[]
args
)
throws
IOException
{
String
fileName
=
args
[
0
];
Long
[]
currentTimings
=
new
Long
[
10000
];
int
processedLines
=
0
;
List
<
Long
>
buckets
=
new
LinkedList
<
Long
>();
LOGGER
.
trace
(
"Reading "
+
fileName
);
CharSource
charSource
=
Files
.
asCharSource
(
new
File
(
fileName
),
Charsets
.
UTF_8
);
BufferedReader
bufferedStream
=
charSource
.
openBufferedStream
();
String
line
;
while
(
null
!=
(
line
=
bufferedStream
.
readLine
()))
{
String
[]
strings
=
line
.
split
(
";"
);
Long
timing
=
new
Long
(
strings
[
1
]);
currentTimings
[
processedLines
]
=
timing
;
processedLines
++;
if
(
currentTimings
.
length
==
processedLines
)
{
Long
aggregatedTimings
=
StatisticsUtil
.
calculateAverage
(
Arrays
.
asList
(
currentTimings
));
buckets
.
add
(
aggregatedTimings
);
processedLines
=
0
;
}
}
LOGGER
.
trace
(
"#buckets: "
+
buckets
.
size
());
List
<
Long
>
durationsInNs
=
buckets
.
subList
(
buckets
.
size
()
/
2
,
buckets
.
size
());
LOGGER
.
trace
(
"Calculating quantiles..."
);
Map
<
Double
,
Long
>
quintiles
=
StatisticsUtil
.
calculateQuintiles
(
durationsInNs
);
LOGGER
.
info
(
StatisticsUtil
.
getQuantilesString
(
quintiles
));
long
confidenceWidth
=
StatisticsUtil
.
calculateConfidenceWidth
(
durationsInNs
);
LOGGER
.
info
(
"Confidence width: "
+
confidenceWidth
);
}
}
This diff is collapsed.
Click to expand it.
JCTools
@
88e1e25f
Compare
75998aa2
...
88e1e25f
Subproject commit
75998aa20b7ec897ec321c1f94192de888f2dc6e
Subproject commit
88e1e25f9519b250258c7e5ada30935975ab2d10
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