Skip to content
Snippets Groups Projects
Commit 502e4527 authored by Matthias's avatar Matthias
Browse files

Hostname now optional

parent f5c7ae50
No related branches found
No related tags found
No related merge requests found
kieker.log.directory=traceFiles
kieker.log.hostname=KIEKER-DEMO-SRV
\ No newline at end of file
kieker.log.directory=traceFiles
\ No newline at end of file
......@@ -90,8 +90,10 @@ public class KiekerManager {
}
}
this.traceFileHostName= (String) prop.get(KiekerHelper.KIEKER_LOG_HOSTNAME);
if (this.traceFileHostName == ""){
this.traceFileHostName = KiekerHelper.getHostName();
if (this.traceFileHostName == null){
// no special hostname for filtering, accept all
this.traceFileHostName = "";
//this.traceFileHostName = KiekerHelper.getHostName();
}
log("TraceFiles found under "+traceFileOutputPath);
startAnalysis();
......@@ -191,8 +193,8 @@ public class KiekerManager {
log("Starting analysis...");
try{
Configuration analysisConfiguration = KiekerHelper.createAnalysisConfig(request, traceFileOutputPath,traceFileHostName);
KiekerAnalysisController c = new KiekerAnalysisController(analysisConfiguration);
boolean ignoreHost = this.traceFileHostName.equals("");
KiekerAnalysisController c = new KiekerAnalysisController(analysisConfiguration,ignoreHost);
c.fillTrace();
this.analysisResult = c.getTrace();
this.analysisResult.sortChronological();
......
......@@ -12,9 +12,11 @@ public class KiekerAnalysisController {
private final Configuration config;
public static final String CONFIG_LOG4J_FILE_PATH = "LOG4J_FILE_PATH";
private Trace trace;
private boolean ignoreHost = false;
public KiekerAnalysisController(Configuration config) {
public KiekerAnalysisController(Configuration config, boolean ignoreHost) {
this.config=config;
this.ignoreHost = ignoreHost;
}
public KiekerAnalysisController(String configFilePath) {
......@@ -73,7 +75,7 @@ public class KiekerAnalysisController {
t = new KiekerTraceLoader(t)
.loadKiekerTraceFromDirectories(traceDirectories.toArray(new String[traceDirectories.size()]));
this.trace = t.initializeMaps();
this.trace = t.initializeMaps(ignoreHost);
}
......
......@@ -35,6 +35,7 @@ public class Trace {
}
}
//preset identifiers connected to Components/Resources (Components/Resources initialized via name only)
private Map<ComponentIdentifier, Component> componentIdentifierToComponentMap; //must be preset
private Map<ResourceIdentifier, Resource> resourceIdentifierToResourceMap; //must be preset
......@@ -103,16 +104,22 @@ public class Trace {
resources.add(event);
}
public Trace initializeMaps() {
public Trace initializeMaps(boolean ignoreHost) {
idToRequestMap = new HashMap<String, Request>();
componentToTraceMap = new HashMap<Component, Trace>();
resourceToTraceMap = new HashMap<Resource, Trace>();
for (EventRecord event : events) {
if (ignoreHost){
event.getIdentifier().setHostID("");
}
if (addToComponentMap(event)) {
addToRequestMap(event);
}
}
for (ResourceRecord resource : resources) {
if (ignoreHost){
resource.getIdentifier().setHostID("");
}
addToResourceMap(resource);
}
return this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment