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
3539ee89
Commit
3539ee89
authored
10 years ago
by
Christian Wulf
Browse files
Options
Downloads
Patches
Plain Diff
fixed TcpTraceReduction
parent
0a797e14
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/Pipeline.java
+1
-1
1 addition, 1 deletion
src/main/java/teetime/stage/Pipeline.java
src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java
+33
-18
33 additions, 18 deletions
...t/java/teetime/examples/kiekerdays/TcpTraceReduction.java
with
34 additions
and
19 deletions
src/main/java/teetime/stage/Pipeline.java
+
1
−
1
View file @
3539ee89
...
...
@@ -15,7 +15,7 @@ import teetime.framework.validation.InvalidPortConnection;
* @param <L>
* the type of the last stage in this pipeline
*/
public
class
Pipeline
<
L
extends
IStage
>
implements
IStage
{
public
final
class
Pipeline
<
L
extends
IStage
>
implements
IStage
{
private
final
IStage
firstStage
;
private
final
L
lastStage
;
...
...
This diff is collapsed.
Click to expand it.
src/performancetest/java/teetime/examples/kiekerdays/TcpTraceReduction.java
+
33
−
18
View file @
3539ee89
...
...
@@ -8,10 +8,15 @@ import java.util.TreeMap;
import
teetime.framework.IStage
;
import
teetime.framework.RunnableStage
;
import
teetime.framework.pipe.SingleElementPipe
;
import
teetime.framework.pipe.IPipe
;
import
teetime.framework.pipe.IPipeFactory
;
import
teetime.framework.pipe.PipeFactoryRegistry
;
import
teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering
;
import
teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication
;
import
teetime.framework.pipe.SpScPipe
;
import
teetime.stage.Clock
;
import
teetime.stage.InstanceOfFilter
;
import
teetime.stage.Pipeline
;
import
teetime.stage.Relay
;
import
teetime.stage.basic.Sink
;
import
teetime.stage.basic.distributor.Distributor
;
...
...
@@ -36,7 +41,7 @@ public class TcpTraceReduction {
private
final
List
<
TraceEventRecords
>
elementCollection
=
new
LinkedList
<
TraceEventRecords
>();
private
final
ConcurrentHashMapWithDefault
<
Long
,
TraceBuffer
>
traceId2trace
=
new
ConcurrentHashMapWithDefault
<
Long
,
TraceBuffer
>(
new
TraceBuffer
());
private
final
Map
<
TraceEventRecords
,
TraceAggregationBuffer
>
trace2buffer
=
new
TreeMap
<
TraceEventRecords
,
TraceAggregationBuffer
>(
new
TraceComperator
());
private
final
List
<
SpSc
Pipe
>
tcpRelayPipes
=
new
ArrayList
<
SpSc
Pipe
>();
private
final
List
<
I
Pipe
>
tcpRelayPipes
=
new
ArrayList
<
I
Pipe
>();
private
Thread
tcpThread
;
private
Thread
clockThread
;
...
...
@@ -44,11 +49,19 @@ public class TcpTraceReduction {
private
int
numWorkerThreads
;
private
final
IPipeFactory
intraThreadPipeFactory
;
private
final
IPipeFactory
interThreadPipeFactory
;
public
TcpTraceReduction
()
{
intraThreadPipeFactory
=
PipeFactoryRegistry
.
INSTANCE
.
getPipeFactory
(
ThreadCommunication
.
INTRA
,
PipeOrdering
.
ARBITRARY
,
false
);
interThreadPipeFactory
=
PipeFactoryRegistry
.
INSTANCE
.
getPipeFactory
(
ThreadCommunication
.
INTER
,
PipeOrdering
.
QUEUE_BASED
,
false
);
}
public
void
init
()
{
IStage
tcpPipeline
=
this
.
buildTcpPipeline
();
Pipeline
<
Distributor
<
IMonitoringRecord
>>
tcpPipeline
=
this
.
buildTcpPipeline
();
this
.
tcpThread
=
new
Thread
(
new
RunnableStage
(
tcpPipeline
));
IStage
clockStage
=
this
.
buildClockPipeline
(
5000
);
Pipeline
<
Distributor
<
Long
>>
clockStage
=
this
.
buildClockPipeline
(
5000
);
this
.
clockThread
=
new
Thread
(
new
RunnableStage
(
clockStage
));
this
.
numWorkerThreads
=
Math
.
min
(
NUM_VIRTUAL_CORES
,
this
.
numWorkerThreads
);
...
...
@@ -60,24 +73,24 @@ public class TcpTraceReduction {
}
}
private
IStage
buildTcpPipeline
()
{
private
Pipeline
<
Distributor
<
IMonitoringRecord
>>
buildTcpPipeline
()
{
TcpReader
tcpReader
=
new
TcpReader
();
Distributor
<
IMonitoringRecord
>
distributor
=
new
Distributor
<
IMonitoringRecord
>();
S
in
gleElementPipe
.
connect
(
tcpReader
.
getOutputPort
(),
distributor
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
tcpReader
.
getOutputPort
(),
distributor
.
getInputPort
());
return
tcpReader
;
return
new
Pipeline
<
Distributor
<
IMonitoringRecord
>>(
tcpReader
,
distributor
)
;
}
private
IStage
buildClockPipeline
(
final
long
intervalDelayInMs
)
{
private
Pipeline
<
Distributor
<
Long
>>
buildClockPipeline
(
final
long
intervalDelayInMs
)
{
Clock
clock
=
new
Clock
();
clock
.
setInitialDelayInMs
(
intervalDelayInMs
);
clock
.
setIntervalDelayInMs
(
intervalDelayInMs
);
Distributor
<
Long
>
distributor
=
new
Distributor
<
Long
>();
S
in
gleElementPipe
.
connect
(
clock
.
getOutputPort
(),
distributor
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
clock
.
getOutputPort
(),
distributor
.
getInputPort
());
return
clock
;
return
new
Pipeline
<
Distributor
<
Long
>>(
clock
,
distributor
)
;
}
private
IStage
buildPipeline
(
final
Distributor
<
IMonitoringRecord
>
tcpReaderPipeline
,
final
Distributor
<
Long
>
clockStage
)
{
...
...
@@ -90,15 +103,15 @@ public class TcpTraceReduction {
Sink
<
TraceEventRecords
>
endStage
=
new
Sink
<
TraceEventRecords
>();
// connect stages
SpSc
Pipe
tcpRelayPipe
=
SpScPipe
.
connect
(
tcpReaderPipeline
.
getNewOutputPort
(),
relay
.
getInputPort
(),
TCP_RELAY_MAX_SIZE
);
I
Pipe
tcpRelayPipe
=
interThreadPipeFactory
.
create
(
tcpReaderPipeline
.
getNewOutputPort
(),
relay
.
getInputPort
(),
TCP_RELAY_MAX_SIZE
);
this
.
tcpRelayPipes
.
add
(
tcpRelayPipe
);
S
in
gleElementPipe
.
connect
(
relay
.
getOutputPort
(),
instanceOfFilter
.
getInputPort
());
S
in
gleElementPipe
.
connect
(
instanceOfFilter
.
getOutputPort
(),
traceReconstructionFilter
.
getInputPort
());
S
in
gleElementPipe
.
connect
(
traceReconstructionFilter
.
getTraceValidOutputPort
(),
traceReductionFilter
.
getInputPort
());
S
in
gleElementPipe
.
connect
(
traceReductionFilter
.
getOutputPort
(),
endStage
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
relay
.
getOutputPort
(),
instanceOfFilter
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
instanceOfFilter
.
getOutputPort
(),
traceReconstructionFilter
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
traceReconstructionFilter
.
getTraceValidOutputPort
(),
traceReductionFilter
.
getInputPort
());
in
traThreadPipeFactory
.
create
(
traceReductionFilter
.
getOutputPort
(),
endStage
.
getInputPort
());
SpScPipe
.
connect
(
clockStage
.
getNewOutputPort
(),
traceReductionFilter
.
getTriggerInputPort
(),
10
);
interThreadPipeFactory
.
create
(
clockStage
.
getNewOutputPort
(),
traceReductionFilter
.
getTriggerInputPort
(),
10
);
return
relay
;
}
...
...
@@ -126,8 +139,10 @@ public class TcpTraceReduction {
public
void
onTerminate
()
{
int
maxNumWaits
=
0
;
for
(
SpScPipe
pipe
:
this
.
tcpRelayPipes
)
{
maxNumWaits
=
Math
.
max
(
maxNumWaits
,
pipe
.
getNumWaits
());
for
(
IPipe
pipe
:
this
.
tcpRelayPipes
)
{
SpScPipe
interThreadPipe
=
(
SpScPipe
)
pipe
;
// TODO introduce IInterThreadPipe
maxNumWaits
=
Math
.
max
(
maxNumWaits
,
interThreadPipe
.
getNumWaits
());
}
System
.
out
.
println
(
"max #waits of TcpRelayPipes: "
+
maxNumWaits
);
}
...
...
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