diff --git a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/AbstractResourceDemandFilter.java b/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/AbstractResourceDemandFilter.java deleted file mode 100644 index 919500a9a0918fe51e705b4aaffcd79a730b9564..0000000000000000000000000000000000000000 --- a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/AbstractResourceDemandFilter.java +++ /dev/null @@ -1,241 +0,0 @@ -/** - * ============================================== - * PMX : Performance Model eXtractor - * ============================================== - * - * (c) Copyright 2014-2015, by Juergen Walter and Contributors. - * - * Project Info: http://descartes.tools/pmx - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ -package tools.descartes.pmx.filter.resourcedemands; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.InputMismatchException; -import java.util.Map; -import java.util.Scanner; -import java.util.Set; - -import kieker.analysis.IProjectContext; -import kieker.analysis.plugin.annotation.InputPort; -import kieker.analysis.plugin.annotation.OutputPort; -import kieker.analysis.plugin.annotation.Plugin; -import kieker.common.configuration.Configuration; -import kieker.common.record.system.CPUUtilizationRecord; -import kieker.tools.traceAnalysis.filter.AbstractMessageTraceProcessingFilter; - -import org.apache.log4j.Logger; - -import tools.descartes.librede.LibredeResults; -import tools.descartes.librede.ResultTable; -import tools.descartes.librede.approach.IEstimationApproach; -import tools.descartes.librede.approach.ResponseTimeApproximationApproach; -import tools.descartes.librede.approach.ServiceDemandLawApproach; -import tools.descartes.librede.linalg.LinAlg; -import tools.descartes.librede.linalg.Matrix; -import tools.descartes.librede.linalg.Vector; -import tools.descartes.librede.repository.TimeSeries; -import tools.descartes.pmx.builder.ModelBuilder; -import tools.descartes.pmx.filter.resourcedemands.adapter.LibReDEAdapter; - -@Plugin(name = "AbstractResourceDemandFilter", -description = "Resource demand estimation.", -outputPorts = { - @OutputPort(name = AbstractResourceDemandFilter.OUTPUT_PORT_NAME_DEMANDS, - description = "Outputs resource demands", - eventTypes = {HashMap.class }) -}) -public abstract class AbstractResourceDemandFilter extends AbstractMessageTraceProcessingFilter { - - private static final Scanner SCANNER = new Scanner(System.in); - public static final String CONFIG_PROPERTY_NAME_OUTPUT_FN = "outputDirectory"; - public static final String OUTPUT_PORT_NAME_DEMANDS = "resourceDemands"; - private static Map<String, TimeSeries> serviceTimeSeriesMap; - private static Map<String, TimeSeries> resourceTimeSeriesMap; - private static TimeSeries networkTimeSeries; - private static Set<String> hosts = new HashSet<String>(); - private final String outputPath; - private static final Logger log = Logger.getLogger(AbstractResourceDemandFilter.class); - - public static final String INPUT_PORT_NAME_MESSAGE_TRACE = "messageTrace"; - public static final String INPUT_PORT_NAME_EXECUTION_TRACES = "executionTraces"; - public static final String INPUT_PORT_NAME_UTILIZATION = "cpu"; - - - public AbstractResourceDemandFilter(final Configuration configuration, - final IProjectContext projectContext) { - super(configuration, projectContext); - this.outputPath = configuration - .getPathProperty(CONFIG_PROPERTY_NAME_OUTPUT_FN); - serviceTimeSeriesMap = new HashMap<String, TimeSeries>(); - resourceTimeSeriesMap = new HashMap<String, TimeSeries>(); - } - - @InputPort(name = INPUT_PORT_NAME_UTILIZATION, description = "...", eventTypes = { CPUUtilizationRecord.class }) - public abstract void runUtilizationFilter(final CPUUtilizationRecord record); -// @InputPort(name = INPUT_PORT_NAME_MESSAGE_TRACE, description = "Extract class-information from monitoring record", eventTypes = { MessageTrace.class }) -// public abstract void runMessageTraceFilter(final MessageTrace trace); - - - public static void addNetworkLog(double timestamp, double delay) { - if(networkTimeSeries== null){ - double[] timeValue = new double[1]; - timeValue[0] = timestamp; - Vector time = LinAlg.vector(timeValue); - - double[] values = new double[1]; - values[0] = delay; - Matrix data = LinAlg.matrix(values); - networkTimeSeries = new TimeSeries(time, data); - }else{ - networkTimeSeries = networkTimeSeries.addSample(timestamp, delay); - } - } - - public static synchronized void addResourceLog(double timestamp, String host, String resource, double utilization){ - TimeSeries timeSeries; - String key = resource+"_"+host; - if (!resourceTimeSeriesMap.containsKey(key)) { - double[] timeValue = new double[1]; - timeValue[0] = timestamp; - Vector time = LinAlg.vector(timeValue); - - double[] values = new double[1]; - values[0] = utilization; - Matrix data = LinAlg.matrix(values); - timeSeries = new TimeSeries(time, data); - resourceTimeSeriesMap.put(key, timeSeries); - } else { - timeSeries = resourceTimeSeriesMap.get(key); - timeSeries = timeSeries.addSample(timestamp, utilization); - resourceTimeSeriesMap.put(key, timeSeries); - } - - } - - public static synchronized void addExecutionLog(double timestamp, - String interfaceName, String host, double exTime) { - TimeSeries timeSeries = null; - String key = interfaceName+ModelBuilder.seperatorChar+host; - if(exTime < 0 ){ - //log.error("negative execution time. " +host+" "+interfaceName + ": "+exTime); - //exTime = Math.abs(exTime); - exTime = 0; - } - - hosts.add(host); - if (!serviceTimeSeriesMap.containsKey(key)) { - double[] timeValue = new double[1]; - timeValue[0] = timestamp; - Vector time = LinAlg.vector(timeValue); - - double[] values = new double[1]; - values[0] = exTime; - Matrix data = LinAlg.matrix(values); - timeSeries = new TimeSeries(time, data); - serviceTimeSeriesMap.put(key, timeSeries); - } else { - timeSeries = serviceTimeSeriesMap.get(key); - timeSeries = timeSeries.addSample(timestamp, exTime); - serviceTimeSeriesMap.put(key, timeSeries); - } - } - - - /** - * {@inheritDoc} - */ - @Override - public void terminate(final boolean errorBeforeTermination) { - if(serviceTimeSeriesMap.keySet().isEmpty()){ - log.error("could not extract service times to estimate resource demands"); //No service execution logs could be found - return; - } - - HashMap<String, Double> resourceDemandMap = new HashMap<String, Double>(); - for (String host : hosts) { - StringBuffer sb = new StringBuffer(); - for (String service : serviceTimeSeriesMap.keySet()) { - if (service.endsWith(host)) { - sb.append(service.replace(ModelBuilder.seperatorChar + host, "") + " | "); - } - } - log.info("Estimate resource demands on [" + host + "]"); - log.info("\tservices: |" + sb.toString()); - - /** Run LibReDE */ - LibredeResults estimates = LibReDEAdapter.initAndRunLibrede(host, serviceTimeSeriesMap, - resourceTimeSeriesMap, outputPath); - - Set<Class<? extends IEstimationApproach>> approaches = estimates.getApproaches(); - Class<? extends IEstimationApproach> approach; - if (approaches.contains(ServiceDemandLawApproach.class)) { - approach = ServiceDemandLawApproach.class; - } else { - approach = ResponseTimeApproximationApproach.class; - } - - ResultTable resultTable = estimates.getEstimates(approach, 0); - Vector x = resultTable.getLastEstimates(); - for (int i = 0; i < x.rows(); i++) { - // String resourceName = resultTable.getResource(i).getName(); - String serviceName = resultTable.getService(i).getName(); - double rd = x.get(i); - resourceDemandMap.put(serviceName, rd); - } - } - - // Network delay - if (networkTimeSeries != null) { - Vector networkDelayVector = networkTimeSeries.getData(0); - double averageDelay = LinAlg.sum(networkDelayVector).get(0) / networkDelayVector.rows(); - double stdDev = 0; - for (double d : networkDelayVector.toArray1D()) { - stdDev += Math.abs(d - averageDelay); - } - stdDev = stdDev / networkDelayVector.rows(); - // log.info("\taverageDelay "+averageDelay+", stdDev "+stdDev); - if (stdDev > 0.5 * averageDelay) { - log.info("\tstandard deviation for network delays high (" + stdDev + ") compared to average delay (" - + averageDelay + "). Maybe extend model with network package size parameters."); - // log.info("\t==> network model accuracy INsufficient"); - } else { - log.info("\tstandard deviation for network delays (" + stdDev + ") is ok compared to average delay (" - + averageDelay + ")"); - // log.info("\t==> network model accuracy sufficient"); - } - resourceDemandMap.put("Network", averageDelay); - } - super.deliver(AbstractResourceDemandFilter.OUTPUT_PORT_NAME_DEMANDS, resourceDemandMap); - super.terminate(errorBeforeTermination); - } - - private static int getInputInt() { - try { - return SCANNER.nextInt(); - } catch (InputMismatchException e) { - int result = 2; - log.info("Input could not be parsed as a number. Value has been set to "+result+"!"); - return result; - } - } - - -} diff --git a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/CPUFilter.java b/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/CPUFilter.java deleted file mode 100644 index fde63d1535ade27c7568b34d7184611d9dfc6855..0000000000000000000000000000000000000000 --- a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/CPUFilter.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * ============================================== - * PMX : Performance Model eXtractor - * ============================================== - * - * (c) Copyright 2014-2015, by Juergen Walter and Contributors. - * - * Project Info: http://descartes.tools/pmx - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ -package tools.descartes.pmx.filter.resourcedemands; - -import kieker.analysis.IProjectContext; -import kieker.analysis.plugin.annotation.InputPort; -import kieker.analysis.plugin.annotation.OutputPort; -import kieker.analysis.plugin.annotation.Plugin; -import kieker.analysis.plugin.filter.AbstractFilterPlugin; -import kieker.common.configuration.Configuration; -import kieker.common.record.IMonitoringRecord; -import kieker.common.record.system.CPUUtilizationRecord; - -@Plugin(name = "CPU utilization filter", description = "Extracts CPU-utilization-information from incoming monitoring records", outputPorts = { - @OutputPort(name = CPUFilter.OUTPUT_PORT_NAME_UTILIZATION, description = "Outputs CPUUtilRecords", eventTypes = { IMonitoringRecord.class }), - @OutputPort(name = CPUFilter.OUTPUT_PORT_NAME_OTHER, description = "Outputs untouched information", eventTypes = { IMonitoringRecord.class }) }) -public class CPUFilter extends AbstractFilterPlugin { - - public static final String INPUT_PORT_NAME = "newMonitoringRecord"; - public static final String OUTPUT_PORT_NAME_UTILIZATION = "cpu"; - public static final String OUTPUT_PORT_NAME_OTHER = "untouchedIMonitoringRecords"; - - public CPUFilter(final Configuration configuration, - final IProjectContext projectContext) { - super(configuration, projectContext); - } - - @InputPort(name = CPUFilter.INPUT_PORT_NAME, description = "Extract resource-information from monitoring record", eventTypes = { IMonitoringRecord.class }) - public void runFilter(final Object record) { - if (record instanceof CPUUtilizationRecord) { - //log.info("record "+record); - //final CPUUtilizationRecord cpuUtilizationRecord = (CPUUtilizationRecord) record; - super.deliver(OUTPUT_PORT_NAME_UTILIZATION, (CPUUtilizationRecord) record); - } else { - super.deliver(OUTPUT_PORT_NAME_OTHER, record); - } - } - - @Override - public Configuration getCurrentConfiguration() { - return new Configuration(); - } -} diff --git a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ExternalCallTimesAppenderFilter.java b/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ExternalCallTimesAppenderFilter.java deleted file mode 100644 index b09d10407e513c2a4d12a7a3e7ec1b3dd6a843a0..0000000000000000000000000000000000000000 --- a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ExternalCallTimesAppenderFilter.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * ============================================== - * PMX : Performance Model eXtractor - * ============================================== - * - * (c) Copyright 2014-2015, by Juergen Walter and Contributors. - * - * Project Info: http://descartes.tools/pmx - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ -package tools.descartes.pmx.filter.resourcedemands; - -import java.util.HashMap; -import java.util.List; -import kieker.analysis.IProjectContext; -import kieker.analysis.plugin.annotation.InputPort; -import kieker.analysis.plugin.annotation.OutputPort; -import kieker.analysis.plugin.annotation.Plugin; -import kieker.common.configuration.Configuration; -import kieker.tools.traceAnalysis.filter.AbstractTraceAnalysisFilter; -import kieker.tools.traceAnalysis.systemModel.AbstractMessage; -import kieker.tools.traceAnalysis.systemModel.Execution; -import kieker.tools.traceAnalysis.systemModel.MessageTrace; - -@Plugin(name = "ExternalCallTimesAppenderFilter", description = "Adds times for external calls to total time.", outputPorts = { @OutputPort(name = AbstractResourceDemandFilter.OUTPUT_PORT_NAME_DEMANDS, description = "Outputs resource demands", eventTypes = { HashMap.class }), }) -public class ExternalCallTimesAppenderFilter extends AbstractTraceAnalysisFilter{ - - public ExternalCallTimesAppenderFilter(final Configuration configuration, - final IProjectContext projectContext) { - super(configuration, projectContext); - } - - public static final String INPUT_PORT_NAME_MESSAGE_TRACE = "messageTrace"; - - @InputPort(name = ExternalCallTimesAppenderFilter.INPUT_PORT_NAME_MESSAGE_TRACE, description = "Extract class-information from monitoring record", eventTypes = { MessageTrace.class }) - public void runMessageTraceFilter(final MessageTrace trace) { -// Map<Execution, Double> externalCallTime = new HashMap<Execution, Double>(); -// Map<String, Double> aggregatedExternalCallTime = new HashMap<String, Double>(); -// Map<String, Double> aggregatedCallTime = new HashMap<String, Double>(); -// Map<String, List<String>> externalCallMethods = new HashMap<String, List<String>>(); - - List<AbstractMessage> messages = trace.getSequenceAsVector(); - for (AbstractMessage message : messages) { - Execution x = message.getSendingExecution(); - Execution y = message.getReceivingExecution(); - - if (x.getEss() < y.getEss()) { -// x.getTout = y.getTout // y always less - } - } - } - - @Override - public void terminate(boolean errorBeforeTermination) { - super.terminate(errorBeforeTermination); - } - -} diff --git a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/InternalResourceDemandFilter.java b/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/InternalResourceDemandFilter.java deleted file mode 100644 index 6aaba14f021cae710d4a44a22cd9c64dc16fd37e..0000000000000000000000000000000000000000 --- a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/InternalResourceDemandFilter.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * ============================================== - * PMX : Performance Model eXtractor - * ============================================== - * - * (c) Copyright 2014-2015, by Juergen Walter and Contributors. - * - * Project Info: http://descartes.tools/pmx - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ -package tools.descartes.pmx.filter.resourcedemands; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import kieker.analysis.IProjectContext; -import kieker.analysis.plugin.annotation.InputPort; -import kieker.analysis.plugin.annotation.OutputPort; -import kieker.analysis.plugin.annotation.Plugin; -import kieker.common.configuration.Configuration; -import kieker.common.record.system.CPUUtilizationRecord; -import kieker.tools.traceAnalysis.filter.AbstractMessageTraceProcessingFilter; -import kieker.tools.traceAnalysis.systemModel.AbstractMessage; -import kieker.tools.traceAnalysis.systemModel.AllocationComponent; -import kieker.tools.traceAnalysis.systemModel.Execution; -import kieker.tools.traceAnalysis.systemModel.MessageTrace; - -import org.apache.log4j.Logger; - -import tools.descartes.librede.units.Time; -import tools.descartes.pmx.builder.ModelBuilder; - -@Plugin(name = "InternalResourceDemandFilter", -description = "Subtracts times for external calls from total time for resource demand estimation.", -outputPorts = { - @OutputPort(name = AbstractResourceDemandFilter.OUTPUT_PORT_NAME_DEMANDS, - description = "Outputs resource demands", eventTypes = { HashMap.class }) -}) -public class InternalResourceDemandFilter extends AbstractResourceDemandFilter { - - private static final Logger log = Logger - .getLogger(InternalResourceDemandFilter.class); - - public InternalResourceDemandFilter(final Configuration configuration, - final IProjectContext projectContext) { - super(configuration, projectContext); - } - - @InputPort(name = InternalResourceDemandFilter.INPUT_PORT_NAME_UTILIZATION, description = "...", eventTypes = { CPUUtilizationRecord.class }) - public void runUtilizationFilter(final CPUUtilizationRecord record) { - //TODO Check it is loggingTimestamp or timestamp - addResourceLog(Time.NANOSECONDS.convertTo(record.getLoggingTimestamp(), Time.SECONDS), record.getHostname(), "CPU", record.getTotalUtilization()); - } - - -// @InputPort(name = InternalResourceDemandFilter.INPUT_PORT_NAME_MESSAGE_TRACE, description = "Extract class-information from monitoring record", eventTypes = { MessageTrace.class }) -// public void runMessageTraceFilter(final MessageTrace trace) { -// List<AbstractMessage> messages = trace.getSequenceAsVector(); -// for (AbstractMessage message : messages) { -// Execution sender = message.getSendingExecution(); -// Execution receiver = message.getReceivingExecution(); -// if (sender.getEss() < receiver.getEss()) { -// double time = (receiver.getTout() - receiver.getTin()); -// -// addExecutionLog(Time.NANOSECONDS.convertTo(receiver.getTin(), Time.SECONDS), -// receiver.getAllocationComponent().getAssemblyComponent() -// .getType().getTypeName() -// + "." + receiver.getOperation().getSignature().getName(), receiver.getAllocationComponent() -// .getExecutionContainer().getName(), -// time); -// } -// -// } -// } - - - private static String getKey(Execution x) { - String key = ""+x.hashCode(); - return key; - } - - public void terminate(boolean errorBeforeTermination) { - super.terminate(errorBeforeTermination); - } - - @Override - @InputPort(name = AbstractMessageTraceProcessingFilter.INPUT_PORT_NAME_MESSAGE_TRACES, description = "Receives the message traces to be processed", - eventTypes = { MessageTrace.class }) - public void inputMessageTraces(final MessageTrace mt) { - Map<Execution, Double> externalCallTime = new HashMap<Execution, Double>(); - Map<Execution, List<Execution>> externalCallMethods = new HashMap<Execution, List<Execution>>(); - - List<AbstractMessage> messages = mt.getSequenceAsVector(); - for (AbstractMessage message : messages) { - Execution sender = message.getSendingExecution(); - Execution receiver = message.getReceivingExecution(); - if (sender.getEss() < receiver.getEss()) { - if (!externalCallTime.containsKey(sender)) { - externalCallTime.put(sender, (double) 0); - } - if (!externalCallTime.containsKey(receiver)) { - externalCallTime.put(receiver, (double) 0); - } - // Time lost at linking resources - if (!sender.getAllocationComponent() - .getExecutionContainer() - .equals(receiver.getAllocationComponent() - .getExecutionContainer())) { - if(!sender.getAllocationComponent().getAssemblyComponent().getName().equals("'Entry'")){ - // sender != receiver - //log.info("Network ("+sender.getAllocationComponent().getExecutionContainer().getName()+ " == >" + receiver.getAllocationComponent().getExecutionContainer().getName()+"): " - // + (sender.getTout() - receiver.getTin()) - //); - double networkDelay = (receiver.getTin() - sender.getTout()); - double timestamp = sender.getTout(); - addNetworkLog(timestamp, networkDelay); - } - } - - double externalTime = (receiver.getTout() - receiver.getTin()); - externalCallTime.put(sender, externalCallTime.get(sender) + externalTime); - - List<Execution> list = externalCallMethods.get(sender); - list = (list == null) ? new ArrayList<Execution>() : list; - list.add(receiver); - externalCallMethods.put(sender, list); - } - - } - - for (Execution execution : externalCallTime.keySet()) { - if (execution.getAllocationComponent().getAssemblyComponent().getType().getTypeName().contains("Entry")) { - continue; - } - - double time = (execution.getTout() - execution.getTin()); - double externalTime = externalCallTime.get(execution); - if (time < 0) { - log.error("time < 0: time = " + time); - } - - //if(true){ - if(externalTime - time > 0.001 * time) { // measurement >10% uncertain - //TODO External calls - boolean error = true; - AllocationComponent ac = execution.getAllocationComponent(); - for(Execution sub: externalCallMethods.get(execution)){ - if(!ac.equals(sub.getAllocationComponent())){ - error = false; - }; - } - - if(error){ - log.error("time < external time (trace id "+execution.getTraceId()+") "+execution.getAllocationComponent().getAssemblyComponent().getType().getTypeName() + " "+execution.getOperation().getSignature().getName()); - log.error("\t"+ "time = " + time ); - log.error("\t"+ "exte = " + externalTime); - if(externalCallMethods.get(execution) != null){ - for(Execution sub : externalCallMethods.get(execution)){ - log.error("\t"+" "+(sub.getTout() -sub.getTin()) +" << "+sub.getAllocationComponent().getAssemblyComponent().getType().getTypeName() + " "+ sub.getOperation().getSignature().getName() + "(trace id "+sub.getTraceId()+") "); - } - } - }else{ - log.info(execution.getAllocationComponent().getAssemblyComponent().getType().getTypeName() + " "+execution.getOperation().getSignature().getName() + " has been abortet before external call response (trace id "+execution.getTraceId()+")"); - } - externalTime = 0.0; - } - - // Data connection to superclass - addExecutionLog(Time.NANOSECONDS.convertTo(execution.getTin(), Time.SECONDS), - execution.getAllocationComponent().getAssemblyComponent() - .getType().getTypeName() - + ModelBuilder.seperatorChar + execution.getOperation().getSignature().getName(), execution.getAllocationComponent() - .getExecutionContainer().getName(), - (time - externalTime)); - } - // //Aufl�sung der Zeimessung < 1ms - // // Michael Kupperberg aufl�sung von Timern - } -} diff --git a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ResourceDemandFilterAppender.java b/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ResourceDemandFilterAppender.java deleted file mode 100644 index 8530d9cb2cec9936f9aeb8e4e60dfe7ec498b9bc..0000000000000000000000000000000000000000 --- a/tools.descartes.pmx/src/tools/descartes/pmx/filter/resourcedemands/ResourceDemandFilterAppender.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * ============================================== - * PMX : Performance Model eXtractor - * ============================================== - * - * (c) Copyright 2014-2015, by Juergen Walter and Contributors. - * - * Project Info: http://descartes.tools/pmx - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ -package tools.descartes.pmx.filter.resourcedemands; - -import java.io.File; -import java.util.concurrent.TimeUnit; - -import kieker.analysis.IAnalysisController; -import kieker.analysis.exception.AnalysisConfigurationException; -import kieker.analysis.plugin.filter.AbstractFilterPlugin; -import kieker.common.configuration.Configuration; -import kieker.tools.traceAnalysis.filter.AbstractMessageTraceProcessingFilter; -import kieker.tools.traceAnalysis.filter.AbstractTraceAnalysisFilter; -import kieker.tools.traceAnalysis.filter.flow.TraceEventRecords2ExecutionAndMessageTraceFilter; -import kieker.tools.traceAnalysis.filter.traceReconstruction.TraceReconstructionFilter; -import kieker.tools.traceAnalysis.filter.visualization.dependencyGraph.OperationDependencyGraphAllocationFilter; -import kieker.tools.traceAnalysis.filter.visualization.dependencyGraph.ResponseTimeNodeDecorator; -import kieker.tools.traceAnalysis.systemModel.repository.SystemModelRepository; -import tools.descartes.pmx.filter.WorkloadFilter; -import tools.descartes.pmx.filter.controlflow.CallNodeDecorator; -import tools.descartes.pmx.filter.resourcedemands.CPUFilter; - -public class ResourceDemandFilterAppender { - - private static InternalResourceDemandFilter addInternalResourceDemandFilter( - final AbstractFilterPlugin traceEvents2ExecutionAndMessageTraceFilter, - CPUFilter cpuFilter, String resultPath, - IAnalysisController analysisController) - throws AnalysisConfigurationException { - - final Configuration resourceDemandFilterConfiguration = new Configuration(); - resourceDemandFilterConfiguration.setProperty( - AbstractResourceDemandFilter.CONFIG_PROPERTY_NAME_OUTPUT_FN, - resultPath + File.separator+ "resourcedemands"); - (new File(resultPath + File.separator + "resourcedemands"+File.separator)).mkdirs(); - - InternalResourceDemandFilter internalResourceDemandFilter = new InternalResourceDemandFilter( - resourceDemandFilterConfiguration, analysisController); - - analysisController.connect(cpuFilter, - CPUFilter.OUTPUT_PORT_NAME_UTILIZATION, - internalResourceDemandFilter, - InternalResourceDemandFilter.INPUT_PORT_NAME_UTILIZATION); - - analysisController - .connect( - traceEvents2ExecutionAndMessageTraceFilter, - TraceEventRecords2ExecutionAndMessageTraceFilter.OUTPUT_PORT_NAME_MESSAGE_TRACE, - internalResourceDemandFilter, - AbstractMessageTraceProcessingFilter.INPUT_PORT_NAME_MESSAGE_TRACES); - return internalResourceDemandFilter; - } - - private static WorkloadFilter addWorkloadFilter( - final AbstractFilterPlugin traceEvents2ExecutionAndMessageTraceFilter, - IAnalysisController analysisController) - throws AnalysisConfigurationException { - - WorkloadFilter workloadFilter = new WorkloadFilter(new Configuration(), - analysisController); - - analysisController - .connect( - traceEvents2ExecutionAndMessageTraceFilter, - TraceEventRecords2ExecutionAndMessageTraceFilter.OUTPUT_PORT_NAME_MESSAGE_TRACE, - workloadFilter, - AbstractMessageTraceProcessingFilter.INPUT_PORT_NAME_MESSAGE_TRACES); - - return workloadFilter; - } - - /** - * Requires message traces - * - * @param analysisController - * @param systemModelRepository - * @param traceEvents2ExecutionAndMessageTraceFilter - * @throws IllegalStateException - * @throws AnalysisConfigurationException - */ - private static OperationDependencyGraphAllocationFilter addOperationDependencyGraphAllocationFilter( - IAnalysisController analysisController, - SystemModelRepository systemModelRepository, - AbstractFilterPlugin traceEvents2ExecutionAndMessageTraceFilter) - throws IllegalStateException, AnalysisConfigurationException { - final OperationDependencyGraphAllocationFilter operationDependencyGraphAllocationFilter = new OperationDependencyGraphAllocationFilter( - new Configuration(), analysisController); - operationDependencyGraphAllocationFilter - .addDecorator(new ResponseTimeNodeDecorator( - TimeUnit.NANOSECONDS)); - operationDependencyGraphAllocationFilter - .addDecorator(new CallNodeDecorator()); - - analysisController.connect(operationDependencyGraphAllocationFilter, - AbstractTraceAnalysisFilter.REPOSITORY_PORT_NAME_SYSTEM_MODEL, - systemModelRepository); - analysisController - .connect( - traceEvents2ExecutionAndMessageTraceFilter, - TraceEventRecords2ExecutionAndMessageTraceFilter.OUTPUT_PORT_NAME_MESSAGE_TRACE, - operationDependencyGraphAllocationFilter, - AbstractMessageTraceProcessingFilter.INPUT_PORT_NAME_MESSAGE_TRACES); - return operationDependencyGraphAllocationFilter; - } - -}