Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moobench
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
SustainKieker
moobench
Commits
7cd6f2cc
Commit
7cd6f2cc
authored
11 years ago
by
Jan Waller
Browse files
Options
Downloads
Patches
Plain Diff
added new BenchmarkingThread
parent
53ccd4c8
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/mooBench/benchmark/BenchmarkingThreadMilli.java
+65
-0
65 additions, 0 deletions
src/mooBench/benchmark/BenchmarkingThreadMilli.java
with
65 additions
and
0 deletions
src/mooBench/benchmark/BenchmarkingThreadMilli.java
0 → 100644
+
65
−
0
View file @
7cd6f2cc
/***************************************************************************
* Copyright 2014 Kieker Project (http://kieker-monitoring.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
mooBench.benchmark
;
import
java.util.concurrent.CountDownLatch
;
import
mooBench.monitoredApplication.MonitoredClass
;
/**
* @author Jan Waller
*/
public
final
class
BenchmarkingThreadMilli
implements
BenchmarkingThread
{
private
final
MonitoredClass
mc
;
private
final
CountDownLatch
doneSignal
;
private
final
int
totalCalls
;
private
final
long
methodTime
;
private
final
int
recursionDepth
;
private
final
long
[]
timings
;
public
BenchmarkingThreadMilli
(
final
MonitoredClass
mc
,
final
int
totalCalls
,
final
long
methodTime
,
final
int
recursionDepth
,
final
CountDownLatch
doneSignal
)
{
this
.
mc
=
mc
;
this
.
doneSignal
=
doneSignal
;
this
.
totalCalls
=
totalCalls
;
this
.
methodTime
=
methodTime
;
this
.
recursionDepth
=
recursionDepth
;
this
.
timings
=
new
long
[
totalCalls
];
}
public
final
long
[]
getTimings
()
{
synchronized
(
this
)
{
return
this
.
timings
;
}
}
public
final
void
run
()
{
long
start_ns
;
long
stop_ns
;
for
(
int
i
=
0
;
i
<
this
.
totalCalls
;
i
++)
{
start_ns
=
System
.
currentTimeMillis
();
this
.
mc
.
monitoredMethod
(
this
.
methodTime
,
this
.
recursionDepth
);
stop_ns
=
System
.
currentTimeMillis
();
this
.
timings
[
i
]
=
stop_ns
-
start_ns
;
if
((
i
%
100000
)
==
0
)
{
System
.
out
.
println
(
i
);
// NOPMD (System.out)
}
}
this
.
doneSignal
.
countDown
();
}
}
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