Skip to content
Snippets Groups Projects
Commit dccabbda authored by Jürgen Walter's avatar Jürgen Walter
Browse files

minor fix: pmx does not break if number of cores is not given

parent 4eaa2b64
No related branches found
No related tags found
No related merge requests found
...@@ -293,12 +293,13 @@ public class PMXCommandLine { ...@@ -293,12 +293,13 @@ public class PMXCommandLine {
} }
} }
private static void initFileLogging(String path, String logFileName, Layout layout) { private static void initFileLogging(String directory, String logFileName, Layout layout) {
try { try {
// add logging to file // add logging to file
//new File(outputDir).isDirectory()?(outputDir):(outputDir+ File.separator) //new File(outputDir).isDirectory()?(outputDir):(outputDir+ File.separator)
log.info("logging to file "+path + logFileName); String path = directory + File.separator + logFileName;
FileAppender fileAppender = new FileAppender(layout, logFileName, false); log.info("logging to file " + path);
FileAppender fileAppender = new FileAppender(layout, path, false);
BasicConfigurator.configure(fileAppender); BasicConfigurator.configure(fileAppender);
} catch (Exception ex) { } catch (Exception ex) {
log.error("Error during inialization of logging"); log.error("Error during inialization of logging");
......
...@@ -29,6 +29,8 @@ package tools.descartes.pmx.filter.util; ...@@ -29,6 +29,8 @@ package tools.descartes.pmx.filter.util;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import org.apache.log4j.Logger;
import kieker.common.util.signature.Signature; import kieker.common.util.signature.Signature;
import kieker.tools.traceAnalysis.systemModel.AllocationComponent; import kieker.tools.traceAnalysis.systemModel.AllocationComponent;
import kieker.tools.traceAnalysis.systemModel.AssemblyComponent; import kieker.tools.traceAnalysis.systemModel.AssemblyComponent;
...@@ -39,8 +41,7 @@ import kieker.tools.traceAnalysis.systemModel.repository.SystemModelRepository; ...@@ -39,8 +41,7 @@ import kieker.tools.traceAnalysis.systemModel.repository.SystemModelRepository;
import tools.descartes.pmx.builder.IModelBuilder; import tools.descartes.pmx.builder.IModelBuilder;
public class PerformanceModelCreator { public class PerformanceModelCreator {
// private static final Logger log = Logger private static final Logger log = Logger.getLogger(PerformanceModelCreator.class);
// .getLogger(PerformanceModelCreator.class);
// public static void createPerformanceModel(SystemModelRepository // public static void createPerformanceModel(SystemModelRepository
// systemModel, IModelBuilder builder) { // systemModel, IModelBuilder builder) {
...@@ -100,7 +101,15 @@ public class PerformanceModelCreator { ...@@ -100,7 +101,15 @@ public class PerformanceModelCreator {
final Collection<ExecutionContainer> executionContainers = systemModel final Collection<ExecutionContainer> executionContainers = systemModel
.getExecutionEnvironmentFactory().getExecutionContainers(); .getExecutionEnvironmentFactory().getExecutionContainers();
for (ExecutionContainer container : executionContainers) { for (ExecutionContainer container : executionContainers) {
builder.addHost(container.getName(), numCores.get(container.getName())); int numberOfCores =0;
try{
numberOfCores = numCores.get(container.getName());
}catch (Exception e) {
log.error("could not find number of cores for " + container.getName());
log.info("assumed numberOfCores = 2");
numberOfCores = 2;
}
builder.addHost(container.getName(), numberOfCores);
} }
} }
......
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