public static CounterBenchmarkSetting CreateBenchmarkSetting(CounterMeasurementAttribute counterMeasurement) { var throughputAssertion = counterMeasurement as CounterThroughputAssertionAttribute; var totalAssertion = counterMeasurement as CounterTotalAssertionAttribute; if (throughputAssertion != null) { return(new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Throughput, new Assertion(throughputAssertion.Condition, throughputAssertion.AverageOperationsPerSecond, throughputAssertion.MaxAverageOperationsPerSecond))); } if (totalAssertion != null) { return(new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Total, new Assertion(totalAssertion.Condition, totalAssertion.AverageOperationsTotal, totalAssertion.MaxAverageOperationsTotal))); } return(new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Total, Assertion.Empty)); }
public static CounterBenchmarkSetting CreateBenchmarkSetting(CounterMeasurementAttribute counterMeasurement) { var throughputAssertion = counterMeasurement as CounterThroughputAssertionAttribute; var totalAssertion = counterMeasurement as CounterTotalAssertionAttribute; if (throughputAssertion != null) { return new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Throughput, new Assertion(throughputAssertion.Condition, throughputAssertion.AverageOperationsPerSecond, throughputAssertion.MaxAverageOperationsPerSecond)); } if (totalAssertion != null) { return new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Total, new Assertion(totalAssertion.Condition, totalAssertion.AverageOperationsTotal, totalAssertion.MaxAverageOperationsTotal)); } return new CounterBenchmarkSetting(counterMeasurement.CounterName, AssertionType.Total, Assertion.Empty); }