Example #1
0
 public int CompareTo(IInstanceMetric other)
 {
     if (other.Type != Type)
     {
         throw new ArgumentException(Messages.CanNotCompareMetrics(this, other));
     }
     return(Value.CompareTo(other.Value));
 }
        public IResult AddOrUpdateMetric(Uri uri, IInstanceMetric metric)
        {
            if (!_instances.TryGetValue(uri, out var instance))
            {
                return(Result.Failure(Messages.InstanceDoesntExistMessage(uri)));
            }
            UpdateMetricInternal(instance.Metrics, metric.Type, metric);

            return(Result.Success(Messages.MetricHasBeenUpdated(metric)));
        }
Example #3
0
 public int CompareTo(IInstanceMetric other)
 {
     return(Value.CompareTo(other.Value));
 }
 private static void UpdateMetricInternal(IDictionary <MetricType, IInstanceMetric> metrics, MetricType metricType, IInstanceMetric metric)
 {
     metrics[metricType] = metric;
 }