Esempio n. 1
0
        public MetricDefinition(string name, Func <double> nextValueProvider, AggregationStrategy aggregationStrategy)
        {
            Name = name;
            AggregationStrategy = aggregationStrategy;

            this.nextValueProvider = nextValueProvider;
        }
Esempio n. 2
0
 public MetricConfiguration(string name, string type, string path, AggregationStrategy aggregationStrategy, TimeSpan?refreshEvery)
 {
     Name = name;
     Type = type;
     Path = path;
     AggregationStrategy = aggregationStrategy;
     RefreshEvery        = refreshEvery;
 }
Esempio n. 3
0
        public RabbitMqMetricSource(IMetricConfiguration metric)
        {
            name = metric.Name;
            aggregationStrategy = metric.AggregationStrategy;

            uri = new Uri(Environment.ExpandEnvironmentVariables(metric.Path));
            RewriteUrl(ref uri, out credentials);

            jsonSerializer = new DataContractJsonSerializer(typeof(Overview));
        }
            public AggregationStrategyTest()
            {
                Table = new Mock <ITableWrapper>();

                Updater = new Mock <IComponentAffectingEntityUpdater <TEntityAggregation> >();

                Strategy = new AggregationStrategy <TAggregatedEntity, TEntityAggregation>(
                    Table.Object,
                    Updater.Object,
                    Mock.Of <ILogger <AggregationStrategy <TAggregatedEntity, TEntityAggregation> > >());
            }
 public void MergeFrom(Settings other)
 {
     if (other == null)
     {
         return;
     }
     if (other.aggregationStrategy_ != null)
     {
         if (aggregationStrategy_ == null)
         {
             aggregationStrategy_ = new global::Google.Android.PerformanceTuner.Settings.Types.AggregationStrategy();
         }
         AggregationStrategy.MergeFrom(other.AggregationStrategy);
     }
     histograms_.Add(other.histograms_);
     if (other.BaseUri.Length != 0)
     {
         BaseUri = other.BaseUri;
     }
     if (other.ApiKey.Length != 0)
     {
         ApiKey = other.ApiKey;
     }
     if (other.DefaultFidelityParametersFilename.Length != 0)
     {
         DefaultFidelityParametersFilename = other.DefaultFidelityParametersFilename;
     }
     if (other.InitialRequestTimeoutMs != 0)
     {
         InitialRequestTimeoutMs = other.InitialRequestTimeoutMs;
     }
     if (other.UltimateRequestTimeoutMs != 0)
     {
         UltimateRequestTimeoutMs = other.UltimateRequestTimeoutMs;
     }
     if (other.LoadingAnnotationIndex != 0)
     {
         LoadingAnnotationIndex = other.LoadingAnnotationIndex;
     }
     if (other.LevelAnnotationIndex != 0)
     {
         LevelAnnotationIndex = other.LevelAnnotationIndex;
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (aggregationStrategy_ != null)
            {
                hash ^= AggregationStrategy.GetHashCode();
            }
            hash ^= histograms_.GetHashCode();
            if (BaseUri.Length != 0)
            {
                hash ^= BaseUri.GetHashCode();
            }
            if (ApiKey.Length != 0)
            {
                hash ^= ApiKey.GetHashCode();
            }
            if (DefaultFidelityParametersFilename.Length != 0)
            {
                hash ^= DefaultFidelityParametersFilename.GetHashCode();
            }
            if (InitialRequestTimeoutMs != 0)
            {
                hash ^= InitialRequestTimeoutMs.GetHashCode();
            }
            if (UltimateRequestTimeoutMs != 0)
            {
                hash ^= UltimateRequestTimeoutMs.GetHashCode();
            }
            if (LoadingAnnotationIndex != 0)
            {
                hash ^= LoadingAnnotationIndex.GetHashCode();
            }
            if (LevelAnnotationIndex != 0)
            {
                hash ^= LevelAnnotationIndex.GetHashCode();
            }
            return(hash);
        }
Esempio n. 7
0
 public Metric(string name, AggregationStrategy aggregationStrategy, double value)
 {
     Name = name;
     AggregationStrategy = aggregationStrategy;
     Value = value;
 }
Esempio n. 8
0
 public MemcachedMetricSource(IMetricConfiguration metric)
 {
     name = metric.Name;
     aggregationStrategy = metric.AggregationStrategy;
     uri = new Uri(Environment.ExpandEnvironmentVariables(metric.Path));
 }
 public PerformanceCounterMetricDefinition(string name, Func <double> nextValueProvider, AggregationStrategy aggregationStrategy) :
     base(name, nextValueProvider, aggregationStrategy)
 {
 }