Skip to content

Commit 5f41b79

Browse files
author
Reiner Jung
committed
updated behavior evaluation tool.
1 parent 6516ac3 commit 5f41b79

File tree

16 files changed

+398
-108
lines changed

16 files changed

+398
-108
lines changed

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/clustering/IClustering.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
*/
2424
public interface IClustering {
2525

26+
/**
27+
* Cluster instances.
28+
*
29+
* @param instances
30+
* the instances to be clustered
31+
* @return the clustered object
32+
*/
2633
public Object clusterInstances(Instances instances);
2734

2835
}

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TBehaviorModelCreation.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public class TBehaviorModelCreation extends AbstractConsumerStage<Instances> {
4242

4343
private final OutputPort<BehaviorModel> outputPort = this.createOutputPort();
4444

45+
/**
46+
* Constructor for the behavior model creation filter.
47+
*
48+
* @param namePrefix
49+
* prefix for the behavior model
50+
*/
4551
public TBehaviorModelCreation(final String namePrefix) {
4652
this.namePrefix = namePrefix;
4753
}

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TBehaviorModelVisualization.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ public class TBehaviorModelVisualization extends AbstractModelOutputFilter {
5959

6060
/**
6161
* constructor.
62+
*
63+
* @param baseUrl
64+
* @param signatureStrategy
6265
*/
6366
public TBehaviorModelVisualization(final String baseUrl, final ISignatureCreationStrategy signatureStrategy) {
6467
this.objectMapper = new ObjectMapper();
@@ -84,7 +87,7 @@ protected void execute(final BehaviorModel model) {
8487
}
8588

8689
/**
87-
* create graph at visualisation backend.
90+
* Create graph at visualization backend.
8891
*
8992
* @param name
9093
* name
@@ -209,7 +212,7 @@ private void createNodes(final Set<EntryCallNode> entryCallNodes, final long mod
209212
}
210213

211214
/**
212-
* create new edges at visualisation backend.
215+
* create new edges at visualization backend.
213216
*
214217
* @param entryCallEdges
215218
* entryCallEdges
@@ -238,7 +241,7 @@ private void createEdges(final Set<EntryCallEdge> entryCallEdges, final long mod
238241
}
239242

240243
/**
241-
* post elements to server
244+
* post elements to server.
242245
*
243246
* @param elem
244247
* element
@@ -279,7 +282,7 @@ private JsonNode postElement(final ObjectNode elem, final String targetUrl) {
279282
}
280283

281284
/**
282-
* get graph url
285+
* get graph url.
283286
*
284287
* @param modelId
285288
* modelId
@@ -290,7 +293,7 @@ private String getGraphUrl(final long modelId) {
290293
}
291294

292295
/**
293-
* get node url
296+
* get node url.
294297
*
295298
* @param modelId
296299
* modelId
@@ -301,7 +304,7 @@ private String getNodeUrl(final long modelId) {
301304
}
302305

303306
/**
304-
* get edge url
307+
* get edge url.
305308
*
306309
* @param modelId
307310
* modelId

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TDensityClustering.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
/**
3030
* Filter for different density based clustering algorithms. Intended to be used with a following
31-
* cluster merger stage
31+
* cluster merger stage.
3232
*
3333
* @author Marc Adolf
3434
*
@@ -38,6 +38,11 @@ public class TDensityClustering extends AbstractConsumerStage<Instances> {
3838
private final OutputPort<Map<Integer, List<Pair<Instance, Double>>>> outputPort = this.createOutputPort();
3939
private final IDensitityClustering clustering;
4040

41+
/**
42+
* Density clustering filter.
43+
*
44+
* @param clustering
45+
*/
4146
public TDensityClustering(final IDensitityClustering clustering) {
4247
this.clustering = clustering;
4348
}

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TEntryCallSequenceFilter.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import org.iobserve.analysis.filter.models.EntryCallSequenceModel;
2323
import org.iobserve.analysis.filter.models.UserSession;
2424

25-
import kieker.common.logging.Log;
26-
import kieker.common.logging.LogFactory;
2725
import teetime.framework.AbstractConsumerStage;
2826
import teetime.framework.OutputPort;
2927

@@ -35,8 +33,6 @@
3533
*/
3634

3735
public final class TEntryCallSequenceFilter extends AbstractConsumerStage<EntryCallSequenceModel> {
38-
/** logger. */
39-
private static final Log LOG = LogFactory.getLog(TEntryCallSequenceFilter.class);
4036
private final OutputPort<EntryCallSequenceModel> outputPort = this.createOutputPort();
4137
private final EntryCallFilterRules filter;
4238

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TIObserveUIServer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public class TIObserveUIServer extends AbstractConsumerStage<BehaviorModel> {
4848
private final ObjectMapper objectMapper;
4949

5050
/**
51-
* enum
51+
* enum.
5252
*/
5353
private enum ChangelogType {
5454
CREATE, APPEND
5555
}
5656

5757
/**
58-
* constructor
58+
* constructor.
5959
*/
6060
public TIObserveUIServer() {
6161
this.objectMapper = new ObjectMapper();
@@ -87,7 +87,7 @@ protected void execute(final BehaviorModel behaviorModel) {
8787
}
8888

8989
/**
90-
* create changelog for entry call edge
90+
* create changelog for entry call edge.
9191
*
9292
* @param edge
9393
* edge
@@ -136,7 +136,7 @@ private void toCreateEdgeChangelog(final EntryCallEdge edge, final ArrayList<Obj
136136
}
137137

138138
/**
139-
* create changelogs for entry call nodes
139+
* create changelogs for entry call nodes.
140140
*
141141
* @param entryCallNode
142142
* entryCallNode
@@ -184,7 +184,7 @@ private void toCreateNodeChangelog(final EntryCallNode entryCallNode, final Arra
184184
}
185185

186186
/**
187-
* append information to node
187+
* append information to node.
188188
*
189189
* @param changelogs
190190
* changelogs
@@ -202,7 +202,7 @@ private void appendInformation(final ArrayList<ObjectNode> changelogs, final Str
202202
statusInfo.put("id", this.createID(serviceInstanceID, signature));
203203
statusInfo.put("parentType", "serviceInstance");
204204
statusInfo.put("parentId", serviceInstanceID);
205-
statusInfo.put("timestamp", (new Date()).getTime());
205+
statusInfo.put("timestamp", new Date().getTime());
206206
statusInfo.put("key", signature);
207207
statusInfo.put("value", info.getInformationCode());
208208

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/TUsageModelToBehaviorModel.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,19 @@
4040
import teetime.framework.OutputPort;
4141

4242
/**
43-
* Transforms an entryCallSequenceModel to an UBM UI compatible JSON and sends it to the UBM UI
43+
* Transforms an entryCallSequenceModel to an UBM UI compatible JSON and sends it to the UBM UI.
4444
*
4545
* @author Christoph Dornieden
4646
*
4747
*/
4848
public class TUsageModelToBehaviorModel extends AbstractConsumerStage<UsageModel> {
4949

5050
private final OutputPort<BehaviorModel> outputPort;
51-
private final Map<AbstractUserAction, String> nodeMap;
5251

5352
/**
5453
* constructor
5554
*/
5655
public TUsageModelToBehaviorModel() {
57-
this.nodeMap = new HashMap<>();
5856
this.outputPort = this.createOutputPort();
5957
}
6058

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/composite/TBehaviorModelPreprocessing.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
import org.iobserve.analysis.cdoruserbehavior.filter.models.configuration.BehaviorModelConfiguration;
2323
import org.iobserve.analysis.filter.models.EntryCallSequenceModel;
2424

25-
import kieker.common.logging.Log;
26-
import kieker.common.logging.LogFactory;
2725
import teetime.framework.CompositeStage;
2826
import teetime.framework.InputPort;
2927
import teetime.framework.OutputPort;
@@ -41,9 +39,6 @@
4139

4240
public class TBehaviorModelPreprocessing extends CompositeStage {
4341

44-
/** logger. */
45-
private static final Log LOG = LogFactory.getLog(TBehaviorModelPreprocessing.class);
46-
4742
private final Distributor<EntryCallSequenceModel> distributor;
4843
private final Merger<Object> merger;
4944
private final TEntryCallSequenceFilter tEntryCallSequenceFilter;
@@ -63,8 +58,8 @@ public TBehaviorModelPreprocessing(final BehaviorModelConfiguration configuratio
6358

6459
this.merger = new Merger<>(new SkippingBusyWaitingRoundRobinStrategy());
6560

66-
this.tBehaviorModelTableGeneration = new TBehaviorModelTableGeneration(configuration.getRepresentativeStrategy(),
67-
configuration.keepEmptyTransitions());
61+
this.tBehaviorModelTableGeneration = new TBehaviorModelTableGeneration(
62+
configuration.getRepresentativeStrategy(), configuration.keepEmptyTransitions());
6863

6964
this.tBehaviorModelPreperation = new TBehaviorModelPreperation(configuration.keepEmptyTransitions());
7065

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/models/BehaviorModel.java

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,24 @@ public BehaviorModel() {
4040
this.entryCallEdges = new HashSet<>();
4141
}
4242

43+
public Set<EntryCallNode> getEntryCallNodes() {
44+
return this.entryCallNodes;
45+
}
46+
47+
public Set<EntryCallEdge> getEntryCallEdges() {
48+
return this.entryCallEdges;
49+
}
50+
51+
public String getName() {
52+
return this.name;
53+
}
54+
55+
public void setName(final String name) {
56+
this.name = name;
57+
}
58+
4359
/**
44-
* add an edge to the model
60+
* Add an edge to the model.
4561
*
4662
* @param edge
4763
*/
@@ -89,42 +105,6 @@ public EntryCallNode addNode(final EntryCallNode node) {
89105
return this.mergeNode(node);
90106
}
91107

92-
/**
93-
* getter
94-
*
95-
* @return entry call nodes
96-
*/
97-
public Set<EntryCallNode> getEntryCallNodes() {
98-
return this.entryCallNodes;
99-
}
100-
101-
/**
102-
* getter
103-
*
104-
* @return entry call edges
105-
*/
106-
public Set<EntryCallEdge> getEntryCallEdges() {
107-
return this.entryCallEdges;
108-
}
109-
110-
/**
111-
* getter
112-
*
113-
* @return name
114-
*/
115-
public String getName() {
116-
return this.name;
117-
}
118-
119-
/**
120-
* setter
121-
*
122-
* @param name
123-
*/
124-
public void setName(final String name) {
125-
this.name = name;
126-
}
127-
128108
/**
129109
* merge node into entryCallNodes
130110
*

analysis/src/main/java/org/iobserve/analysis/cdoruserbehavior/filter/models/EntryCallEdge.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,30 @@ public EntryCallEdge(final EntryCallNode source, final EntryCallNode target, fin
6868
this.calls = calls;
6969
}
7070

71+
public EntryCallNode getSource() {
72+
return this.source;
73+
}
74+
75+
public void setSource(final EntryCallNode source) {
76+
this.source = source;
77+
}
78+
79+
public EntryCallNode getTarget() {
80+
return this.target;
81+
}
82+
83+
public void setTarget(final EntryCallNode target) {
84+
this.target = target;
85+
}
86+
87+
public double getCalls() {
88+
return this.calls;
89+
}
90+
91+
public void setCalls(final double calls) {
92+
this.calls = calls < 0 ? 0 : calls;
93+
}
94+
7195
/**
7296
* increment calls.
7397
*/
@@ -104,30 +128,6 @@ public int hashCode() {
104128
return super.hashCode();
105129
}
106130

107-
public EntryCallNode getSource() {
108-
return this.source;
109-
}
110-
111-
public void setSource(final EntryCallNode source) {
112-
this.source = source;
113-
}
114-
115-
public EntryCallNode getTarget() {
116-
return this.target;
117-
}
118-
119-
public void setTarget(final EntryCallNode target) {
120-
this.target = target;
121-
}
122-
123-
public double getCalls() {
124-
return this.calls;
125-
}
126-
127-
public void setCalls(final double calls) {
128-
this.calls = calls < 0 ? 0 : calls;
129-
}
130-
131131
/**
132132
* add calls to the edge.
133133
*

0 commit comments

Comments
 (0)