Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TeeTime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathis Neumann
TeeTime
Commits
61ba4f42
Commit
61ba4f42
authored
9 years ago
by
Marc Adolf
Browse files
Options
Downloads
Patches
Plain Diff
added std deviation
parent
d6ea8374
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/teetime/framework/pipe/measurements/MeasureCollection.java
+63
-2
63 additions, 2 deletions
...eetime/framework/pipe/measurements/MeasureCollection.java
with
63 additions
and
2 deletions
src/main/java/teetime/framework/pipe/measurements/MeasureCollection.java
+
63
−
2
View file @
61ba4f42
...
@@ -80,6 +80,24 @@ public class MeasureCollection {
...
@@ -80,6 +80,24 @@ public class MeasureCollection {
return
result
;
return
result
;
}
}
public
double
activationVariance
()
{
double
expectedValue
=
averageActivationTime
();
double
result
=
0
;
double
count
=
0
;
double
temp
=
0
;
for
(
AbstractStage
stage
:
activationEntries
.
keySet
())
{
for
(
ActivationEntry
entry
:
activationEntries
.
get
(
stage
))
{
temp
=
entry
.
getEndTime
()
-
entry
.
getStartTime
()
-
expectedValue
;
result
+=
temp
*
temp
;
count
++;
}
}
if
(
count
!=
0
)
{
result
=
result
/
count
;
}
return
result
;
}
public
long
averageDeactivationTime
()
{
public
long
averageDeactivationTime
()
{
long
result
=
0
;
long
result
=
0
;
long
count
=
0
;
long
count
=
0
;
...
@@ -97,6 +115,24 @@ public class MeasureCollection {
...
@@ -97,6 +115,24 @@ public class MeasureCollection {
return
result
;
return
result
;
}
}
public
double
deactivationVariance
()
{
double
expectedValue
=
averageDeactivationTime
();
double
result
=
0
;
double
count
=
0
;
double
temp
=
0
;
for
(
AbstractStage
stage
:
deactivationEntries
.
keySet
())
{
for
(
DeactivationEntry
entry
:
deactivationEntries
.
get
(
stage
))
{
temp
=
entry
.
getEndTime
()
-
entry
.
getStartTime
()
-
expectedValue
;
result
+=
temp
*
temp
;
count
++;
}
}
if
(
count
!=
0
)
{
result
=
result
/
count
;
}
return
result
;
}
public
long
averageThreadStopTime
()
{
public
long
averageThreadStopTime
()
{
long
result
=
0
;
long
result
=
0
;
long
count
=
0
;
long
count
=
0
;
...
@@ -114,16 +150,41 @@ public class MeasureCollection {
...
@@ -114,16 +150,41 @@ public class MeasureCollection {
return
result
;
return
result
;
}
}
public
double
threadStopTimeVariance
()
{
double
expectedValue
=
averageThreadStopTime
();
double
result
=
0
;
double
count
=
0
;
double
temp
=
0
;
for
(
AbstractStage
stage
:
deactivationEntries
.
keySet
())
{
for
(
DeactivationEntry
entry
:
deactivationEntries
.
get
(
stage
))
{
temp
=
entry
.
getEndTime
()
-
entry
.
getThreadTerminationTime
()
-
expectedValue
;
result
+=
temp
*
temp
;
count
++;
}
}
if
(
count
!=
0
)
{
result
=
result
/
count
;
}
return
result
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
String
result
=
"All values are given in nanoseconds \n"
;
String
result
=
"All values are given in nanoseconds \n"
;
String
avAT
=
"Average Activation Time"
;
String
avAT
=
"Average Activation Time"
;
String
aTV
=
"Activation Time Standard Deviation"
;
String
avDT
=
"Average Deactivation Time"
;
String
avDT
=
"Average Deactivation Time"
;
String
dTV
=
"Deactivation Time Standard Deviation"
;
String
avTT
=
"Average Time Thread Termination"
;
String
avTT
=
"Average Time Thread Termination"
;
int
n
=
Math
.
max
(
avAT
.
length
(),
Math
.
max
(
avDT
.
length
(),
avTT
.
length
()));
String
tTV
=
"Time Thread Termination Standard Deviation"
;
int
n
=
Math
.
max
(
avAT
.
length
(),
Math
.
max
(
avDT
.
length
(),
Math
.
max
(
avTT
.
length
(),
Math
.
max
(
aTV
.
length
(),
Math
.
max
(
dTV
.
length
(),
tTV
.
length
())))));
result
+=
avAT
+
spaces
(
n
-
avAT
.
length
()
+
1
)
+
": "
+
averageActivationTime
()
+
"\n"
;
result
+=
avAT
+
spaces
(
n
-
avAT
.
length
()
+
1
)
+
": "
+
averageActivationTime
()
+
"\n"
;
result
+=
aTV
+
spaces
(
n
-
aTV
.
length
()
+
1
)
+
": "
+
Math
.
sqrt
(
activationVariance
())
+
"\n"
;
result
+=
avDT
+
spaces
(
n
-
avDT
.
length
()
+
1
)
+
": "
+
averageDeactivationTime
()
+
"\n"
;
result
+=
avDT
+
spaces
(
n
-
avDT
.
length
()
+
1
)
+
": "
+
averageDeactivationTime
()
+
"\n"
;
result
+=
avTT
+
spaces
(
n
-
avTT
.
length
()
+
1
)
+
": "
+
averageThreadStopTime
();
result
+=
dTV
+
spaces
(
n
-
dTV
.
length
()
+
1
)
+
": "
+
Math
.
sqrt
(
deactivationVariance
())
+
"\n"
;
result
+=
avTT
+
spaces
(
n
-
avTT
.
length
()
+
1
)
+
": "
+
averageThreadStopTime
()
+
"\n"
;
result
+=
tTV
+
spaces
(
n
-
tTV
.
length
()
+
1
)
+
": "
+
Math
.
sqrt
(
threadStopTimeVariance
());
return
result
;
return
result
;
}
}
...
...
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