當前位置: 首頁>>代碼示例>>Java>>正文


Java SpotterResult.setDetected方法代碼示例

本文整理匯總了Java中org.spotter.shared.result.model.SpotterResult.setDetected方法的典型用法代碼示例。如果您正苦於以下問題:Java SpotterResult.setDetected方法的具體用法?Java SpotterResult.setDetected怎麽用?Java SpotterResult.setDetected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.spotter.shared.result.model.SpotterResult的用法示例。


在下文中一共展示了SpotterResult.setDetected方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {

	SpotterResult result = new SpotterResult();
	String message = "Detected a test bottleneck!";

	String methodA = "methodA()";
	ProblemOccurrence occurrenceA = new ProblemOccurrence(methodA, message);
	String methodB = "methodB()";
	ProblemOccurrence occurrenceB = new ProblemOccurrence(methodB, message);
	String methodC = "methodC()";
	ProblemOccurrence occurrenceC = new ProblemOccurrence(methodC, message);

	result.addProblemOccurrence(occurrenceA);
	result.addProblemOccurrence(occurrenceB);
	result.addProblemOccurrence(occurrenceC);

	result.setDetected(true);
	result.addMessage("Test detection run finished successfully!");

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:23,代碼來源:TestDetection.java

示例2: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
public SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();

	Dataset rtDataset = data.getDataSets(ResponseTimeRecord.class).get(0);
	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no results for the given scope!");
		return result;
	}
	for (String operation : rtDataset.getValueSet(ResponseTimeRecord.PAR_OPERATION, String.class)) {

		boolean operationDetected = analyseOperationResponseTimes(rtDataset, operation, result);
		if (operationDetected) {
			result.setDetected(true);
			result.addMessage("Ramp detected in operation: " + operation);
		}

	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:23,代碼來源:TimeWindowsStrategy.java

示例3: initProblems

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@BeforeClass
public static void initProblems() {
	problemA = new PerformanceProblem("problemA");
	problemA.setProblemName("problemA");
	resultA = new SpotterResult();
	resultA.setDetected(true);

	problemB = new PerformanceProblem("problemB");
	problemB.setProblemName("problemB");
	resultB = new SpotterResult();
	resultB.setDetected(true);

	problemC = new PerformanceProblem("problemC");
	problemC.setProblemName("problemC");
	resultC = new SpotterResult();
	resultC.setDetected(false);

}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:19,代碼來源:ResultBlackboardTest.java

示例4: testChartStorage

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Test
public void testChartStorage() throws IOException {

	XChartBuilder chartBuilder = new XChartBuilder();
	chartBuilder.startChart("a", "b", "c");
	NumericPairList<Double, Double> pairList = new NumericPairList<>();
	pairList.add(1.0,2.0);
	pairList.add(2.0,5.0);
	pairList.add(3.0,7.0);
	chartBuilder.addScatterSeries(pairList, "test");
	DetectionResultManager drManager = new DetectionResultManager(CONTROLLER_NAME);
	drManager.setProblemId(CONTROLLER_NAME);
	String fileName = "chart";
	SpotterResult result = new SpotterResult();
	result.setDetected(true);
	drManager.storeImageChartResource(chartBuilder, fileName, result);

	Assert.assertEquals(1, result.getResourceFiles().size());
	String file = "1-" + fileName + ".png";
	Assert.assertEquals(file, result.getResourceFiles().get(0));

	File pngFile = new File(baseDir + RESOURCES_DIR + file);
	Assert.assertTrue(pngFile.isFile());
	Assert.assertTrue(pngFile.exists());
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:26,代碼來源:DetectionResultManagerTest.java

示例5: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
public SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();
	result.setDetected(false);

	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);

	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no results for the given scope!");
		return result;
	}

	for (String operation : rtDataset.getValueSet(ResponseTimeRecord.PAR_OPERATION, String.class)) {
		ParameterSelection selectOperation = new ParameterSelection().select(ResponseTimeRecord.PAR_OPERATION,
				operation);
		Dataset operationSpecificDataset = selectOperation.applyTo(rtDataset);

		NumericPairList<Long, Double> responseTimeSeries = Utils.toTimestampRTPairs(operationSpecificDataset);
		// sort chronologically
		responseTimeSeries.sort();

		SimpleRegression regression = LpeNumericUtils.linearRegression(responseTimeSeries);

		double slope = regression.getSlope();
		if (slope > slopeThreshold) {
			result.addMessage("Ramp detected in operation: " + operation);
			result.setDetected(true);
		}

		createChart(result, operation, responseTimeSeries, regression);
	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:36,代碼來源:LinearRegressionStrategy.java

示例6: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {
	LOGGER.debug("Analyze data for GodClass Antipattern..");

	SpotterResult result = new SpotterResult();
	result.setDetected(false);

	/** Process the raw measurement data */
	LOGGER.debug("process data..");
	ProcessedData processData = DataProcessor.processData(data);

	/** Analyze the processed data */
	LOGGER.debug("analyze data..");

	List<Component> blobs = analysisStrategyImpl.analyze(processData, getResultManager(), result);

	if (!blobs.isEmpty()) {
		result.setDetected(true);
		int i = 1;
		for (Component blob : blobs) {
			result.addMessage("Blob Component:");
			result.addMessage("CP " + i + ": " + blob.getId());
			result.addMessage("");
			result.addMessage("");
			result.addMessage("");
			i++;
		}

	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:33,代碼來源:BlobDetectionController.java

示例7: newAnalysis

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
private void newAnalysis(ProcessedData processData, SpotterResult result) {
	for (Component outer : processData.getComponents()) {
		result.addMessage("Investigated component: " + outer.getId());

		List<Double> pctMsgReceivedList = new ArrayList<Double>();
		for (Component inner : processData.getComponents()) {
			if (inner == outer) {
				continue;
			}
			pctMsgReceivedList.add(getRelativeReceivePct(inner));
		}

		double currentMean = LpeNumericUtils.average(pctMsgReceivedList);
		double standardDeviation = LpeNumericUtils.stdDev(pctMsgReceivedList);

		result.addMessage("Component Pct Messages Sent:   " + df.format(getRelativeReceivePct(outer)) + "$");
		result.addMessage("Current Mean:   " + df.format(currentMean) + "$");
		result.addMessage("Current StdDev: " + df.format(standardDeviation) + "%");
		result.addMessage("Critical Threshold (Mean + 3 * SD): "
				+ df.format(currentMean + THREE_SIGMA * standardDeviation) + "%");

		if (currentMean + THREE_SIGMA * standardDeviation < getRelativeReceivePct(outer)) {
			result.addMessage("Result: As GodClass detected");
			result.setDetected(true);
		} else {
			result.addMessage("Result: not detected");
		}
		result.addMessage("* * * *");
	}
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:31,代碼來源:Analyzer.java

示例8: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();

	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);

	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no results for the given scope!");
		return result;
	}

	for (String operation : rtDataset.getValueSet(ResponseTimeRecord.PAR_OPERATION, String.class)) {

		boolean operationDetected = false;
		try {
			operationDetected = analysisStrategyImpl.analyseOperationResponseTimes(rtDataset, operation, result);
		} catch (NullPointerException npe) {
			result.addMessage("Traffic Jam detection failed for the operation '" + operation
					+ "', because the operation was not executed in each analysis cycle.");
			continue;
		} catch (IllegalArgumentException iae) {
			result.addMessage(iae.getMessage());
			continue;
		}

		if (operationDetected) {
			result.setDetected(true);
			result.addMessage("Traffic Jam detected in service: " + operation);

		}

	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:37,代碼來源:TrafficJamDetectionController.java

示例9: addNotDetectedChildrenRecursively

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
/**
 * Marks all children of parent recursively as not detected.
 * 
 * @param parent
 *            the parent problem to start with
 */
private void addNotDetectedChildrenRecursively(PerformanceProblem parent) {
	for (PerformanceProblem child : parent.getChildren()) {

		ProgressManager.getInstance().updateProgressStatus(child.getUniqueId(), DiagnosisStatus.NOT_DETECTED);
		ProgressManager.getInstance().updateProgress(child.getUniqueId(), 1, 0);
		SpotterResult result = new SpotterResult();
		result.setDetected(false);
		ResultBlackboard.getInstance().putResult(child, result);

		addNotDetectedChildrenRecursively(child);

	}
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:20,代碼來源:HierarchyModelInterpreter.java

示例10: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();
	result.setDetected(data.getRecords().size() == NUM_EXPERIMENTS * DummyMeasurement.NUM_RECORDS);

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:8,代碼來源:MockDetection.java

示例11: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();
	result.setDetected(true);
	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:7,代碼來源:DetectionA.java

示例12: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
public SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();
	result.setDetected(false);

	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);

	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no results for the given scope!");
		return result;
	}

	for (String operation : rtDataset.getValueSet(ResponseTimeRecord.PAR_OPERATION, String.class)) {
		ParameterSelection selectOperation = new ParameterSelection().select(ResponseTimeRecord.PAR_OPERATION,
				operation);
		Dataset operationSpecificDataset = selectOperation.applyTo(rtDataset);

		NumericPairList<Long, Double> responseTimeSeries = Utils.toTimestampRTPairs(operationSpecificDataset);
		// sort chronologically
		responseTimeSeries.sort();
		long minTimestamp = responseTimeSeries.getKeyMin();
		long diff = responseTimeSeries.getKeyMax() - responseTimeSeries.getKeyMin();
		long midTimestamp = minTimestamp + (diff) / 2L;

		List<Double> firstHalf = new ArrayList<>();
		List<Double> secondHalf = new ArrayList<>();
		for (NumericPair<Long, Double> valuePair : responseTimeSeries) {
			if (valuePair.getKey() < midTimestamp) {
				firstHalf.add(valuePair.getValue());
			} else {
				secondHalf.add(valuePair.getValue());
			}
		}

		List<Double> sums1 = new ArrayList<>();
		List<Double> sums2 = new ArrayList<>();
		LpeNumericUtils.createNormalDistributionByBootstrapping(firstHalf, secondHalf, sums1, sums2);
		double firstMean = LpeNumericUtils.average(sums1);
		double secondMean = LpeNumericUtils.average(sums2);
		double pValue = LpeNumericUtils.tTest(sums1, sums2);
		if (pValue <= requiredSignificanceLevel && firstMean < secondMean) {
			result.addMessage("Ramp detected in operation: " + operation);
			result.setDetected(true);
		}
		createChart(result, operation, responseTimeSeries, minTimestamp, diff, sums1, sums2, firstMean, secondMean);

	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:52,代碼來源:DirectGrowthStrategy.java

示例13: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {
	long perfReqThreshold = GlobalConfiguration.getInstance().getPropertyAsInteger(
			ConfigKeys.PERFORMANCE_REQUIREMENT_THRESHOLD, ConfigKeys.DEFAULT_PERFORMANCE_REQUIREMENT_THRESHOLD);
	double perfReqConfidence = GlobalConfiguration.getInstance().getPropertyAsDouble(
			ConfigKeys.PERFORMANCE_REQUIREMENT_CONFIDENCE, ConfigKeys.DEFAULT_PERFORMANCE_REQUIREMENT_CONFIDENCE);

	SpotterResult result = new SpotterResult();
	result.setDetected(false);

	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);

	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no results for the given scope!");
		return result;
	}

	for (String operation : rtDataset.getValueSet(ResponseTimeRecord.PAR_OPERATION, String.class)) {
		ParameterSelection selectOperation = new ParameterSelection().select(ResponseTimeRecord.PAR_OPERATION,
				operation);
		Dataset operationSpecificDataset = selectOperation.applyTo(rtDataset);

		NumericPairList<Long, Double> responseTimeSeries = Utils.toTimestampRTPairs(operationSpecificDataset);
		if (responseTimeSeries.size() <= 5) {
			continue;
		}
		// sort chronologically
		responseTimeSeries.sort();
		List<Hiccup> hiccups = analysisStrategyImpl.findHiccups(responseTimeSeries, hiccupDetectionConfig,
				perfReqThreshold, perfReqConfidence, getResultManager(), result);

		long experimentDuration = responseTimeSeries.getKeyMax() - responseTimeSeries.getKeyMin();
		long hiccupsDuration = 0;
		for (Hiccup hiccup : hiccups) {
			hiccupsDuration += hiccup.getEndTimestamp() - hiccup.getStartTimestamp();
		}

		if (hiccups.size() > 1 && hiccupsDuration < maxHiccupTimeProportion * experimentDuration) {
			result.addMessage("Detected hiccup behaviour in operation: " + operation);
			result.setDetected(true);
			createChart(result, operation, responseTimeSeries, hiccups, perfReqThreshold);

		}

	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:50,代碼來源:AppHiccupsController.java

示例14: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
protected SpotterResult analyze(DatasetCollection data) {

	LOGGER.info("Fetching datasets.");

	Dataset sqlDataset = data.getDataSet(SQLQueryRecord.class);
	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);
	Dataset tracingDataset = data.getDataSet(ThreadTracingRecord.class);

	LOGGER.info("Converting SQL dataset.");

	List<SQLQueryRecord> sqlRecords = sqlDataset.getRecords(SQLQueryRecord.class);
	List<ThreadTracingRecord> ttRecords = tracingDataset.getRecords(ThreadTracingRecord.class);

	sqlRecords = filterQueryRecords(sqlRecords, ttRecords);

	LOGGER.info("Converting RT dataset.");

	List<ResponseTimeRecord> rtRecords = rtDataset.getRecords(ResponseTimeRecord.class);
	rtRecords = filterResponsetimeRecords(rtRecords);

	LOGGER.info("Analyzing datasets.");

	Map<String, List<StifleQuery>> stifleQueries = analyzeDatasets(rtRecords, sqlRecords);

	LOGGER.info("Creating results.");

	SpotterResult result = new SpotterResult();
	result.setDetected(false);

	if (!stifleQueries.isEmpty()) {
		result.setDetected(true);
		StringBuilder strBuilder = new StringBuilder();
		for (String operation : stifleQueries.keySet()) {
			strBuilder.append("Stifles in operation " + operation + " found:");
			strBuilder.append("\n");
			List<StifleQuery> stifles = stifleQueries.get(operation);
			for (StifleQuery stifle : stifles) {
				strBuilder.append("Query: " + stifle.getQuery());
				strBuilder.append("\n");
				strBuilder.append("occured: ( " + LpeNumericUtils.min(stifle.getOccurrences()) + " , "
						+ LpeNumericUtils.average(stifle.getOccurrences()) + " , "
						+ LpeNumericUtils.max(stifle.getOccurrences()) + " ) times");
				strBuilder.append("\n");
			}
			strBuilder.append("\n");
			strBuilder.append("\n");
		}
		result.addMessage(strBuilder.toString());
	}

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:54,代碼來源:StifleDetectionController.java

示例15: analyze

import org.spotter.shared.result.model.SpotterResult; //導入方法依賴的package包/類
@Override
public SpotterResult analyze(DatasetCollection data) {
	SpotterResult result = new SpotterResult();

	Dataset rtDataset = data.getDataSet(ResponseTimeRecord.class);

	if (rtDataset == null || rtDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no response time results for the given scope!");
		return result;
	}

	Dataset cpuUtilDataset = data.getDataSet(CPUUtilizationRecord.class);

	if (cpuUtilDataset == null || cpuUtilDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no CPU utilization results for the given scope!");
		return result;
	}

	Dataset networkInfoDataset = data.getDataSet(NetworkInterfaceInfoRecord.class);

	if (networkInfoDataset == null || networkInfoDataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no networkInfoDataset results for the given scope!");
		return result;
	}

	Dataset networkIODataset = data.getDataSet(NetworkRecord.class);

	if (networkIODataset == null || networkIODataset.size() == 0) {
		result.setDetected(false);
		result.addMessage("Instrumentation achieved no netowrk IO results for the given scope!");
		return result;
	}

	List<Integer> numUsersList = getNumUsersList(rtDataset);
	Map<String, NumericPairList<Integer, Double>> responseTimesMap = null;
	if (scope.equals(OLBExtension.DB_SCOPE)) {
		Dataset sqlDataset = data.getDataSet(SQLQueryRecord.class);

		if (sqlDataset == null || sqlDataset.size() == 0) {
			result.setDetected(false);
			result.addMessage("Instrumentation achieved no SQL results for the given scope!");
			return result;
		}

		responseTimesMap = getOperationResponseTimesWithSQL(rtDataset, sqlDataset, result, numUsersList);
	} else {
		responseTimesMap = getOperationResponseTimes(rtDataset, result, numUsersList);

	}
	Map<String, NumericPairList<Integer, Double>> utilsMap = getCPUUtilizations(cpuUtilDataset, result,
			numUsersList);

	utilsMap.putAll(getNetworkUtilizations(networkIODataset, networkInfoDataset, result, numUsersList));
	Map<String, Integer> numServersMap = getNumberOfCPUCores(cpuUtilDataset);
	numServersMap.putAll(getNumberServers(networkInfoDataset));

	// List<String> candidateOperations =
	// analyseResponseTimesIncrease(result, numUsersList, responseTimesMap);
	// Set<String> operations = new HashSet<>();
	// operations.addAll(responseTimesMap.keySet());
	// for (String operation : operations) {
	// if (!candidateOperations.contains(operation)) {
	// responseTimesMap.remove(operation);
	// }
	// }
	analyzeOLB(result, numUsersList, responseTimesMap, utilsMap, numServersMap);

	return result;
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter-Extensions,代碼行數:73,代碼來源:QTStrategy.java


注:本文中的org.spotter.shared.result.model.SpotterResult.setDetected方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。