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
168f9872
There was a problem fetching the pipeline summary.
Commit
168f9872
authored
8 years ago
by
Lars Erik Blümke
Browse files
Options
Downloads
Patches
Plain Diff
Completed test cases for MemSwapUtilizationDisplayFilter
parent
712ca93f
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/test/java/kieker/analysis/plugin/filter/sink/MemSwapUtilizationDisplayFilterTest.java
+27
-2
27 additions, 2 deletions
...ugin/filter/sink/MemSwapUtilizationDisplayFilterTest.java
with
27 additions
and
2 deletions
src/test/java/kieker/analysis/plugin/filter/sink/MemSwapUtilizationDisplayFilterTest.java
+
27
−
2
View file @
168f9872
...
@@ -34,10 +34,14 @@ public class MemSwapUtilizationDisplayFilterTest {
...
@@ -34,10 +34,14 @@ public class MemSwapUtilizationDisplayFilterTest {
private
final
long
swapUsed
=
15728640L
;
private
final
long
swapUsed
=
15728640L
;
private
final
long
swapFree
=
5242880L
;
private
final
long
swapFree
=
5242880L
;
private
String
id
;
@Before
@Before
public
void
initializeMemSwapUtilizationDisplayFilter
()
{
public
void
initializeMemSwapUtilizationDisplayFilter
()
{
record
=
new
MemSwapUsageRecord
(
timestamp
,
hostname
,
memTotal
,
memUsed
,
memFree
,
swapTotal
,
swapUsed
,
swapFree
);
record
=
new
MemSwapUsageRecord
(
timestamp
,
hostname
,
memTotal
,
memUsed
,
memFree
,
swapTotal
,
swapUsed
,
swapFree
);
memSwapUtilFilter
=
new
MemSwapUtilizationDisplayFilter
(
numberOfEntries
,
recordsTimeUnit
);
memSwapUtilFilter
=
new
MemSwapUtilizationDisplayFilter
(
numberOfEntries
,
recordsTimeUnit
);
id
=
record
.
getHostname
();
}
}
@Test
@Test
...
@@ -47,8 +51,6 @@ public class MemSwapUtilizationDisplayFilterTest {
...
@@ -47,8 +51,6 @@ public class MemSwapUtilizationDisplayFilterTest {
final
Date
date
=
new
Date
(
TimeUnit
.
MILLISECONDS
.
convert
(
record
.
getLoggingTimestamp
(),
recordsTimeUnit
));
final
Date
date
=
new
Date
(
TimeUnit
.
MILLISECONDS
.
convert
(
record
.
getLoggingTimestamp
(),
recordsTimeUnit
));
final
String
minutesAndSeconds
=
date
.
toString
().
substring
(
14
,
19
);
final
String
minutesAndSeconds
=
date
.
toString
().
substring
(
14
,
19
);
final
String
id
=
record
.
getHostname
();
long
actualMemTotal
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_TOTAL
).
get
(
minutesAndSeconds
);
long
actualMemTotal
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_TOTAL
).
get
(
minutesAndSeconds
);
long
actualMemUsed
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_USED
).
get
(
minutesAndSeconds
);
long
actualMemUsed
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_USED
).
get
(
minutesAndSeconds
);
long
actualMemFree
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_FREE
).
get
(
minutesAndSeconds
);
long
actualMemFree
=
(
long
)
memSwapUtilFilter
.
getXYPlot
().
getEntries
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_FREE
).
get
(
minutesAndSeconds
);
...
@@ -66,4 +68,27 @@ public class MemSwapUtilizationDisplayFilterTest {
...
@@ -66,4 +68,27 @@ public class MemSwapUtilizationDisplayFilterTest {
}
}
@Test
public
void
memPieChartShouldBeCorrect
()
{
test
(
memSwapUtilFilter
).
and
().
send
(
record
).
to
(
memSwapUtilFilter
.
getInputPort
()).
start
();
long
actualMemFree
=
(
long
)
memSwapUtilFilter
.
getMemPieChart
().
getValue
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_FREE
);
long
actualMemUsed
=
(
long
)
memSwapUtilFilter
.
getMemPieChart
().
getValue
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
MEM_USED
);
assertThat
(
actualMemFree
,
is
(
memFree
));
assertThat
(
actualMemUsed
,
is
(
memUsed
));
}
@Test
public
void
swapPieChartShouldBeCorrect
()
{
test
(
memSwapUtilFilter
).
and
().
send
(
record
).
to
(
memSwapUtilFilter
.
getInputPort
()).
start
();
long
actualSwapFree
=
(
long
)
memSwapUtilFilter
.
getSwapPieChart
().
getValue
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
SWAP_FREE
);
long
actualSwapUsed
=
(
long
)
memSwapUtilFilter
.
getSwapPieChart
().
getValue
(
id
+
" - "
+
MemSwapUtilizationDisplayFilter
.
SWAP_USED
);
assertThat
(
actualSwapFree
,
is
(
swapFree
));
assertThat
(
actualSwapUsed
,
is
(
swapUsed
));
}
}
}
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