Exemplo n.º 1
0
        public override IValue GetValueFor(Criterion criterion)
        {
            if (criterion == SamplingCriteriaContext.TopStackOccurrenceCriterion)
                return _topStackOccurrence;

            if (criterion == SamplingCriteriaContext.DurationCriterion)
                return _duration;

            string message = string.Format("Criterion {0} is not supported for a tracing method",
                                           criterion.GetType().Name);
            throw new ArgumentException(message);
        }
        public IValue GetMaxValueFor(Criterion criterion)
        {
            if (criterion == TopStackOccurrenceCriterion)
                return _maxTopStackOccurrence;

            if (criterion == DurationCriterion)
                return _maxDuration;

            var exceptionMessage = string.Format("Criterion of type {0} is not available in {1}", criterion.GetType().Name,
                                                 this.GetType().Name);
            throw new ArgumentException(exceptionMessage);
        }
        public IValue GetMaxValueFor(Criterion criterion)
        {
            if (criterion == CallCountCriterion)
                return _maxCallCount;
            if (criterion == TimeWallClockCriterion)
                return _maxTimeWallClock;
            if (criterion == TimeActiveCriterion)
                return _maxTimeActive;

            var exceptionMessage = string.Format("Criterion of type {0} is not available in {1}", criterion.GetType().Name,
                                                 this.GetType().Name);
            throw new ArgumentException(exceptionMessage);
        }
Exemplo n.º 4
0
        public override IValue GetValueFor(Criterion criterion)
        {
            if (criterion == TracingCriteriaContext.CallCountCriterion)
                return _callCountValue;

            if (criterion == TracingCriteriaContext.TimeWallClockCriterion)
                return _timeWallClockValue;

            if (criterion == TracingCriteriaContext.TimeActiveCriterion)
                return _timeActiveValue;

            string message = string.Format("Criterion {0} is not supported for a tracing method", criterion.GetType().Name);
            throw new ArgumentException(message);
        }