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
04a7c739
Commit
04a7c739
authored
9 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
worked on
#19
parent
eff8623e
No related branches found
No related tags found
1 merge request
!17
Get impletemented stages and Java 8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/kieker/analysis/dev/DependencyCreatorStage.java
+3
-0
3 additions, 0 deletions
...main/java/kieker/analysis/dev/DependencyCreatorStage.java
src/main/java/kieker/analysis/dev/OperationsDependency.java
+106
-24
106 additions, 24 deletions
src/main/java/kieker/analysis/dev/OperationsDependency.java
with
109 additions
and
24 deletions
src/main/java/kieker/analysis/dev/DependencyCreatorStage.java
+
3
−
0
View file @
04a7c739
...
...
@@ -20,6 +20,9 @@ public class DependencyCreatorStage extends AbstractTransformation<AggregatedTra
// TODO Update Statistics
operationsDependency
.
printDependcies
();
// operationsDependency.printOperations();
this
.
getOutputPort
().
send
(
operationsDependency
);
super
.
onTerminating
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/kieker/analysis/dev/OperationsDependency.java
+
106
−
24
View file @
04a7c739
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
kieker.analysis.traceanalysisdomain.AggregatedOperationCall
;
...
...
@@ -11,54 +12,135 @@ public class OperationsDependency {
// TODO Move to Domain package
private
final
Map
<
String
,
List
<
AggregatedOperationCall
>>
operations
=
new
HashMap
<>();
private
final
Map
<
OperationCallWrapper
,
List
<
AggregatedOperationCall
>>
operations
=
new
HashMap
<>();
private
final
Map
<
String
,
OperationsDependencyRelation
>
calls
=
new
HashMap
<>();
private
final
Map
<
OperationsDependencyRelation
,
Integer
>
calls
=
new
HashMap
<>();
public
void
addCall
(
final
AggregatedOperationCall
call
)
{
// TODO
if
(!
operations
.
containsKey
(
"Key"
))
{
operations
.
put
(
"Key"
,
new
ArrayList
<>());
// TODO Handle failed OCs as own OC? -> currently yes
OperationCallWrapper
key
=
new
OperationCallWrapper
(
new
AggregatedOperationCall
(
call
.
getContainer
(),
call
.
getComponent
(),
call
.
getOperation
(),
0
,
call
.
getFailedCause
()));
OperationCallWrapper
parentKey
=
null
;
if
(
call
.
getParent
()
!=
null
)
{
parentKey
=
new
OperationCallWrapper
(
new
AggregatedOperationCall
(
call
.
getParent
().
getContainer
(),
call
.
getParent
().
getComponent
(),
call
.
getParent
().
getOperation
(),
0
,
call
.
getParent
().
getFailedCause
()));
}
if
(!
operations
.
containsKey
(
key
))
{
operations
.
put
(
key
,
new
ArrayList
<>());
}
operations
.
get
(
key
).
add
(
call
);
o
perations
.
get
(
"Key"
).
add
(
call
);
O
perations
DependencyRelation
keyEdge
=
new
OperationsDependencyRelation
(
key
,
parentKey
);
if
(!
calls
.
containsKey
(
"Key"
))
{
calls
.
put
(
"Key"
,
new
OperationsDependencyRelation
(
call
.
getParent
(),
call
,
call
.
getCalls
())
);
if
(!
calls
.
containsKey
(
keyEdge
))
{
calls
.
put
(
keyEdge
,
0
);
}
calls
.
replace
(
keyEdge
,
(
calls
.
get
(
keyEdge
)
+
call
.
getCalls
()));
}
// TODO Just for debugging
public
void
printOperations
()
{
System
.
out
.
println
(
"Operations:"
);
System
.
out
.
println
();
for
(
Entry
<
OperationCallWrapper
,
List
<
AggregatedOperationCall
>>
call
:
operations
.
entrySet
())
{
calls
.
get
(
"Key"
).
addToCalls
(
call
.
getCalls
());
System
.
out
.
println
(
"Key:"
+
call
.
getKey
().
getOperationCall
().
getOperation
()
+
" / "
+
call
.
getKey
().
getOperationCall
().
getFailedCause
());
System
.
out
.
println
(
"Calls:"
);
for
(
AggregatedOperationCall
call2
:
call
.
getValue
())
{
System
.
out
.
println
(
call2
.
getOperation
());
// System.out.println(call2.getFailedCause());
}
System
.
out
.
println
();
}
}
private
class
OperationsDependencyRelation
{
// TODO Just for debugging
p
rivate
final
AggregatedOperationCall
caller
;
p
ublic
void
printDependcies
()
{
private
final
AggregatedOperationCall
callee
;
System
.
out
.
println
(
"Dependcies"
);
System
.
out
.
println
(
"Size"
+
calls
.
size
());
private
int
calls
;
for
(
Entry
<
OperationsDependencyRelation
,
Integer
>
call
:
calls
.
entrySet
())
{
public
OperationsDependencyRelation
(
final
AggregatedOperationCall
caller
,
final
AggregatedOperationCall
callee
,
final
int
calls
)
{
this
.
caller
=
caller
;
this
.
callee
=
callee
;
this
.
calls
=
calls
;
System
.
out
.
println
(
"Set begin"
);
System
.
out
.
println
(
call
.
getKey
().
getCaller
().
getOperationCall
().
getOperation
());
System
.
out
.
println
(
call
.
getKey
().
getCallee
().
getOperationCall
().
getOperation
());
System
.
out
.
println
(
call
.
getValue
());
System
.
out
.
println
(
"Set end"
);
System
.
out
.
println
();
}
}
/**
* Wrapper class for {@link AggregatedOperationCall} for calculating the hash code and check equality of two {@link AggregatedOperationCall}.
*
* @author Sören Henning
*
*/
private
static
class
OperationCallWrapper
{
public
void
addToCalls
(
final
int
calls
)
{
this
.
calls
+=
calls
;
private
final
AggregatedOperationCall
operationCall
;
public
OperationCallWrapper
(
final
AggregatedOperationCall
operationCall
)
{
this
.
operationCall
=
operationCall
;
}
public
AggregatedOperationCall
getOperationCall
()
{
return
operationCall
;
}
@Override
public
int
hashCode
()
{
return
this
.
operationCall
.
calculateHashCode
();
}
@Override
public
boolean
equals
(
final
Object
obj
)
{
if
(!(
obj
instanceof
OperationCallWrapper
))
{
return
false
;
}
return
this
.
operationCall
.
isEqualTo
(((
OperationCallWrapper
)
obj
).
operationCall
);
}
}
/**
* Relation between two {@link AggregatedOperationCall}. If this class will be
* extended by more attributes, new hashCode() and equals() methods are required.
*
* @author Sören Henning
*
*/
private
class
OperationsDependencyRelation
{
private
final
OperationCallWrapper
caller
;
private
final
OperationCallWrapper
callee
;
public
OperationsDependencyRelation
(
final
OperationCallWrapper
caller
,
final
OperationCallWrapper
callee
)
{
this
.
caller
=
caller
;
this
.
callee
=
callee
;
}
public
Aggregated
OperationCall
getCaller
()
{
public
OperationCall
Wrapper
getCaller
()
{
return
caller
;
}
public
Aggregated
OperationCall
getCallee
()
{
public
OperationCall
Wrapper
getCallee
()
{
return
callee
;
}
public
int
getCalls
()
{
return
calls
;
}
}
}
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