/// <summary> /// Identify break in stability trend /// </summary> private void ExtractStabilityBreak() { Log.WriteLine("calculating stability break on [" + OVERALLTRANSACTIONSKEY + "] by reference [" + OVERALLUSERSKEY + "]"); try { // get timeseries double[] throughput_values = _measureDetails.GetValuesAsDoubleArray(OVERALLTRANSACTIONSKEY); double[] users_values = _measureDetails.GetValuesAsDoubleArray(OVERALLUSERSKEY); double[] error_values = _measureDetails.GetValuesAsDoubleArray(OVERALLERRORSKEY); TrendAnalyzer trendAnalyzer = new TrendAnalyzer(); trendAnalyzer.ReferenceSeries = users_values; // search for trendbreak if stability is expected (duration testing) Log.WriteLine("phase 1: stability of throughput"); int breakThroughput = trendAnalyzer.DetectTrendBreak_Stability(throughput_values); Log.WriteLine("phase 2: stability of errors"); int breakErrors = trendAnalyzer.DetectTrendBreak_Stability(error_values); // break is lowest break level int breakResult = (breakThroughput < breakErrors) ? breakThroughput : breakErrors; trendAnalyzer.BreakIndex = breakResult; _variables.Add(TRENDBREAKSTABILITYPRCKEY, trendAnalyzer.GetBreakPercentage_Progress().ToString("0")); Log.WriteLine(string.Format("trend break STABILITY: break on percentage={0:0}%", trendAnalyzer.GetBreakPercentage_Progress())); } catch (Exception e) { Log.WriteLine("ERROR calculation of stability trend break failed"); Log.WriteLine(e.Message); } }
/// <summary> /// Identify break in ramp up trend /// </summary> private void ExtractRampupBreak() { Log.WriteLine("calculating ramp up break on [" + OVERALLTRANSACTIONSKEY + "] by reference [" + OVERALLUSERSKEY + "]"); try { // get timeseries // double[] throughput_values = _measureDetails.GetValuesAsDoubleArray(OVERALLTRANSACTIONSKEY); double[] responsetimes_values = _measureDetails.GetValuesAsDoubleArray(OVERALLRESPONSETIMEKEY); double[] users_values = _measureDetails.GetValuesAsDoubleArray(OVERALLUSERSKEY); TrendAnalyzer trendAnalyzer = new TrendAnalyzer(); trendAnalyzer.ReferenceSeries = users_values; // search for trend break if stable ramp-up is expected (stress testing) // trendAnalyzer.DetectTrendBreak_Rampup_Throughput(throughput_values); // based on stable rise of throughput (needs more complexity, first try alternative) trendAnalyzer.DetectTrendBreak_Rampup_Responsetimes(responsetimes_values); // based on stability of response times _variables.Add(TRENDBREAKRAMPUPPRCKEY, trendAnalyzer.GetBreakPercentage_Reference().ToString("0")); _variables.Add(TRENDBREAKRAMPUPUSRKEY, trendAnalyzer.GetBreakReferenceValue().ToString()); Log.WriteLine(string.Format("trend break RAMP UP: break on percentage={0:0}% users={1}", trendAnalyzer.GetBreakPercentage_Reference(), trendAnalyzer.GetBreakReferenceValue())); } catch (Exception e) { Log.WriteLine("ERROR calculation of ramp-up trend break failed"); Log.WriteLine(e.Message); } }