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
a3ace7bb
Commit
a3ace7bb
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
moved ISendTraceAggregationBuffer to ctor
parent
70b38d4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/teetime/stage/trace/traceReduction/TraceReductionFilter.java
+3
-3
3 additions, 3 deletions
...time/stage/trace/traceReduction/TraceReductionFilter.java
src/main/java/teetime/util/TraceReductor.java
+5
-3
5 additions, 3 deletions
src/main/java/teetime/util/TraceReductor.java
with
8 additions
and
6 deletions
src/main/java/teetime/stage/trace/traceReduction/TraceReductionFilter.java
+
3
−
3
View file @
a3ace7bb
...
...
@@ -46,14 +46,14 @@ public class TraceReductionFilter extends AbstractConsumerStage<EventBasedTrace>
private
long
maxCollectionDurationInNs
;
public
TraceReductionFilter
(
final
Map
<
EventBasedTrace
,
TraceAggregationBuffer
>
trace2buffer
)
{
this
.
reductor
=
new
TraceReductor
(
trace2buffer
);
this
.
reductor
=
new
TraceReductor
(
trace2buffer
,
this
);
}
@Override
protected
void
execute
(
final
EventBasedTrace
eventBasedTrace
)
{
Long
timestampInNs
=
this
.
triggerInputPort
.
receive
();
if
(
timestampInNs
!=
null
)
{
reductor
.
processTimeoutQueue
(
timestampInNs
,
maxCollectionDurationInNs
,
this
);
reductor
.
processTimeoutQueue
(
timestampInNs
,
maxCollectionDurationInNs
);
}
reductor
.
countSameTraces
(
eventBasedTrace
);
...
...
@@ -61,7 +61,7 @@ public class TraceReductionFilter extends AbstractConsumerStage<EventBasedTrace>
@Override
public
void
onTerminating
()
throws
Exception
{
reductor
.
terminate
(
this
);
reductor
.
terminate
();
// BETTER re-use processTimeoutQueue here, e.g., as follows
// triggerInputPort.getPipe().add(new Date().getTime());
...
...
This diff is collapsed.
Click to expand it.
src/main/java/teetime/util/TraceReductor.java
+
5
−
3
View file @
a3ace7bb
...
...
@@ -16,9 +16,11 @@ import teetime.stage.trace.traceReduction.TraceAggregationBuffer;
public
class
TraceReductor
{
private
final
Map
<
EventBasedTrace
,
TraceAggregationBuffer
>
trace2buffer
;
private
final
ISendTraceAggregationBuffer
sender
;
public
TraceReductor
(
final
Map
<
EventBasedTrace
,
TraceAggregationBuffer
>
trace2buffer
)
{
public
TraceReductor
(
final
Map
<
EventBasedTrace
,
TraceAggregationBuffer
>
trace2buffer
,
final
ISendTraceAggregationBuffer
sender
)
{
this
.
trace2buffer
=
trace2buffer
;
this
.
sender
=
sender
;
}
public
void
countSameTraces
(
final
EventBasedTrace
eventBasedTrace
)
{
...
...
@@ -32,7 +34,7 @@ public class TraceReductor {
}
}
public
void
processTimeoutQueue
(
final
long
timestampInNs
,
final
long
maxCollectionDurationInNs
,
final
ISendTraceAggregationBuffer
sender
)
{
public
void
processTimeoutQueue
(
final
long
timestampInNs
,
final
long
maxCollectionDurationInNs
)
{
final
long
bufferTimeoutInNs
=
timestampInNs
-
maxCollectionDurationInNs
;
synchronized
(
trace2buffer
)
{
for
(
final
Iterator
<
Entry
<
EventBasedTrace
,
TraceAggregationBuffer
>>
iterator
=
trace2buffer
...
...
@@ -46,7 +48,7 @@ public class TraceReductor {
}
}
public
void
terminate
(
final
ISendTraceAggregationBuffer
sender
)
{
public
void
terminate
()
{
synchronized
(
trace2buffer
)
{
// BETTER hide and improve synchronization in the buffer
for
(
final
Entry
<
EventBasedTrace
,
TraceAggregationBuffer
>
entry
:
trace2buffer
.
entrySet
())
{
final
TraceAggregationBuffer
aggregatedTrace
=
entry
.
getValue
();
...
...
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