Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker Trace Diagnosis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Kieker
Kieker Trace Diagnosis
Commits
577ebf06
Commit
577ebf06
authored
10 years ago
by
Nils Christian Ehmke
Browse files
Options
Downloads
Patches
Plain Diff
Used the mapper for the time unit mapping in the data model
parent
b01109e4
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/main/java/kieker/diagnosis/common/model/DataModel.java
+18
-30
18 additions, 30 deletions
src/main/java/kieker/diagnosis/common/model/DataModel.java
with
18 additions
and
30 deletions
src/main/java/kieker/diagnosis/common/model/DataModel.java
+
18
−
30
View file @
577ebf06
...
...
@@ -29,6 +29,7 @@ import kieker.diagnosis.common.domain.AggregatedTrace;
import
kieker.diagnosis.common.domain.OperationCall
;
import
kieker.diagnosis.common.domain.Trace
;
import
kieker.diagnosis.common.model.importer.ImportAnalysisConfiguration
;
import
kieker.diagnosis.common.util.Mapper
;
import
teetime.framework.Analysis
;
/**
...
...
@@ -38,6 +39,8 @@ import teetime.framework.Analysis;
*/
public
final
class
DataModel
extends
Observable
{
private
final
Mapper
<
TimeUnit
,
String
>
shortTimeUnitMapper
=
new
Mapper
<>();
private
List
<
Trace
>
traces
=
Collections
.
emptyList
();
private
List
<
Trace
>
failureContainingTraces
=
Collections
.
emptyList
();
private
List
<
Trace
>
failedTraces
=
Collections
.
emptyList
();
...
...
@@ -51,6 +54,20 @@ public final class DataModel extends Observable {
private
String
shortTimeUnit
=
""
;
public
DataModel
()
{
this
.
initializeMapper
();
}
private
void
initializeMapper
()
{
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
NANOSECONDS
).
to
(
"ns"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
MICROSECONDS
).
to
(
"us"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
MILLISECONDS
).
to
(
"ms"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
SECONDS
).
to
(
"s"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
MINUTES
).
to
(
"m"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
HOURS
).
to
(
"h"
);
this
.
shortTimeUnitMapper
.
map
(
TimeUnit
.
DAYS
).
to
(
"d"
);
}
public
void
loadMonitoringLogFromFS
(
final
String
directory
)
{
// Load and analyze the monitoring logs from the given directory
final
File
importDirectory
=
new
File
(
directory
);
...
...
@@ -83,36 +100,7 @@ public final class DataModel extends Observable {
}
private
String
convertToShortTimeUnit
(
final
TimeUnit
timeUnit
)
{
final
String
result
;
switch
(
timeUnit
)
{
case
DAYS:
result
=
"d"
;
break
;
case
HOURS:
result
=
"h"
;
break
;
case
MICROSECONDS:
result
=
"us"
;
break
;
case
MILLISECONDS:
result
=
"ms"
;
break
;
case
MINUTES:
result
=
"m"
;
break
;
case
NANOSECONDS:
result
=
"ns"
;
break
;
case
SECONDS:
result
=
"s"
;
break
;
default
:
result
=
""
;
break
;
}
return
result
;
return
this
.
shortTimeUnitMapper
.
resolve
(
timeUnit
);
}
public
String
getShortTimeUnit
()
{
...
...
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