Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
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
TeeTime
Kieker-TeeTime-Stages
Commits
520db34b
There was a problem fetching the pipeline summary.
Commit
520db34b
authored
8 years ago
by
Lars Erik Blümke
Browse files
Options
Downloads
Patches
Plain Diff
Migration of ThreadStatusDisplayFilter
parent
168f9872
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/kieker/analysis/plugin/filter/sink/ThreadsStatusDisplayFilter.java
+92
-0
92 additions, 0 deletions
...alysis/plugin/filter/sink/ThreadsStatusDisplayFilter.java
with
92 additions
and
0 deletions
src/main/java/kieker/analysis/plugin/filter/sink/ThreadsStatusDisplayFilter.java
0 → 100644
+
92
−
0
View file @
520db34b
/***************************************************************************
* Copyright 2015 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
kieker.analysis.plugin.filter.sink
;
import
java.util.Date
;
import
java.util.concurrent.TimeUnit
;
import
kieker.analysis.display.XYPlot
;
import
kieker.analysis.display.annotation.Display
;
import
kieker.common.record.jvm.ThreadsStatusRecord
;
import
teetime.stage.basic.AbstractFilter
;
/**
* @author Nils Christian Ehmke, Lars Erik Bluemke
*
* @since 1.10
*/
public
class
ThreadsStatusDisplayFilter
extends
AbstractFilter
<
ThreadsStatusRecord
>
{
private
static
final
String
TOTAL_THREADS
=
"Total Threads"
;
private
static
final
String
THREADS
=
"Threads"
;
private
static
final
String
DAEMON_THREADS
=
"Daemon Threads"
;
private
static
final
String
PEAK_THREADS
=
"Peak Threads"
;
private
final
XYPlot
xyplot
;
private
final
int
numberOfEntries
;
private
final
TimeUnit
recordsTimeUnit
;
/**
* Creates a new instance of this filter.
*
* @param numberOfEntries
* Maximal number of entries in a XYPlot
* @param recordsTimeUnit
* Time unit to interpret the timestamp of a record passed to the input port
*
* @see kieker.analysis.display.XYPlot
*/
public
ThreadsStatusDisplayFilter
(
final
int
numberOfEntries
,
final
TimeUnit
recordsTimeUnit
)
{
this
.
numberOfEntries
=
numberOfEntries
;
this
.
recordsTimeUnit
=
recordsTimeUnit
;
// Create the display objects
this
.
xyplot
=
new
XYPlot
(
this
.
numberOfEntries
);
}
/**
* This method represents the input port receiving the incoming events.
*
* @param record
* The record to display and relay.
*/
@Override
public
void
execute
(
final
ThreadsStatusRecord
record
)
{
this
.
updateDisplays
(
record
);
}
private
void
updateDisplays
(
final
ThreadsStatusRecord
record
)
{
// Calculate the minutes and seconds of the logging timestamp of the record
final
Date
date
=
new
Date
(
TimeUnit
.
MILLISECONDS
.
convert
(
record
.
getLoggingTimestamp
(),
recordsTimeUnit
));
final
String
minutesAndSeconds
=
date
.
toString
().
substring
(
14
,
19
);
final
String
id
=
record
.
getHostname
()
+
" - "
+
record
.
getVmName
();
this
.
xyplot
.
setEntry
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
THREADS
,
minutesAndSeconds
,
record
.
getThreadCount
());
this
.
xyplot
.
setEntry
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
TOTAL_THREADS
,
minutesAndSeconds
,
record
.
getTotalStartedThreadCount
());
this
.
xyplot
.
setEntry
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
PEAK_THREADS
,
minutesAndSeconds
,
record
.
getPeakThreadCount
());
this
.
xyplot
.
setEntry
(
id
+
" - "
+
ThreadsStatusDisplayFilter
.
DAEMON_THREADS
,
minutesAndSeconds
,
record
.
getDaemonThreadCount
());
}
@Display
(
name
=
"XYPlot Display"
)
public
XYPlot
getXYPlot
()
{
return
this
.
xyplot
;
}
}
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