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
0148beca
Commit
0148beca
authored
9 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
removed obsolete class file
parent
3496ee31
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/teetime/util/test/framework/PerformanceTest.java
+0
-87
0 additions, 87 deletions
...est/java/teetime/util/test/framework/PerformanceTest.java
with
0 additions
and
87 deletions
src/test/java/teetime/util/test/framework/PerformanceTest.java
deleted
100644 → 0
+
0
−
87
View file @
3496ee31
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
teetime.util.test.framework
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.rules.TestRule
;
import
org.junit.rules.TestWatcher
;
import
org.junit.runner.Description
;
import
teetime.util.StopWatch
;
import
teetime.util.TimestampObject
;
import
teetime.util.test.eval.PerformanceResult
;
import
teetime.util.test.eval.StatisticsUtil
;
public
abstract
class
PerformanceTest
{
protected
static
final
PerformanceCheckProfileRepository
PERFORMANCE_CHECK_PROFILE_REPOSITORY
=
PerformanceCheckProfileRepository
.
INSTANCE
;
protected
static
final
int
NUM_OBJECTS_TO_CREATE
=
1000000
;
protected
static
final
int
NUM_NOOP_FILTERS
=
800
;
public
static
final
MeasurementRepository
measurementRepository
=
new
MeasurementRepository
();
protected
Description
description
;
protected
StopWatch
stopWatch
;
protected
List
<
TimestampObject
>
timestampObjects
;
static
{
System
.
setProperty
(
"logback.configurationFile"
,
"src/test/resources/logback.groovy"
);
}
@Rule
public
final
TestRule
watcher
=
new
TestWatcher
()
{
@Override
protected
void
starting
(
final
Description
description
)
{
PerformanceTest
.
this
.
description
=
description
;
// System.out.println("getDisplayName(): " + description.getDisplayName());
}
};
@Before
public
void
before
()
{
this
.
stopWatch
=
new
StopWatch
();
this
.
timestampObjects
=
new
ArrayList
<
TimestampObject
>(
NUM_OBJECTS_TO_CREATE
);
}
@After
public
void
after
()
{
String
testMethodIdentifier
=
MeasurementRepository
.
buildTestMethodIdentifier
(
description
.
getTestClass
(),
description
.
getMethodName
());
PerformanceResult
performanceResult
=
StatisticsUtil
.
computeStatistics
(
this
.
stopWatch
.
getDurationInNs
(),
this
.
timestampObjects
);
measurementRepository
.
performanceResults
.
put
(
testMethodIdentifier
,
performanceResult
);
addToRepository
(
performanceResult
);
System
.
out
.
println
(
"Duration: "
+
TimeUnit
.
NANOSECONDS
.
toMillis
(
performanceResult
.
overallDurationInNs
)
+
" ms"
);
System
.
out
.
println
(
"avg duration: "
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
performanceResult
.
avgDurInNs
)
+
" µs"
);
System
.
out
.
println
(
StatisticsUtil
.
getQuantilesString
(
performanceResult
.
quantiles
));
System
.
out
.
println
(
"confidenceWidth: "
+
performanceResult
.
confidenceWidthInNs
+
" ns"
);
System
.
out
.
println
(
"["
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
performanceResult
.
avgDurInNs
-
performanceResult
.
confidenceWidthInNs
)
+
" µs, "
+
TimeUnit
.
NANOSECONDS
.
toMicros
(
performanceResult
.
avgDurInNs
+
performanceResult
.
confidenceWidthInNs
)
+
" µs]"
);
}
@Deprecated
private
void
addToRepository
(
final
PerformanceResult
performanceResult
)
{
measurementRepository
.
performanceResults
.
put
(
this
.
description
.
getDisplayName
(),
performanceResult
);
}
}
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