示例#1
0
        public int CompareTo(MeterMetric other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var startTimeComparison = _startTime.CompareTo(other._startTime);

            if (startTimeComparison != 0)
            {
                return(startTimeComparison);
            }
            var rateUnitComparison = RateUnit.CompareTo(other.RateUnit);

            if (rateUnitComparison != 0)
            {
                return(rateUnitComparison);
            }
            var eventTypeComparison = string.Compare(EventType, other.EventType, StringComparison.Ordinal);

            if (eventTypeComparison != 0)
            {
                return(eventTypeComparison);
            }
            return(Name.CompareTo(other.Name));
        }
示例#2
0
        public int CompareTo(TimerMetric other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            var durationUnitComparison = DurationUnit.CompareTo(other.DurationUnit);

            if (durationUnitComparison != 0)
            {
                return(durationUnitComparison);
            }
            return(RateUnit.CompareTo(other.RateUnit));
        }