Exemple #1
0
        public MetricState(string name, JsonMetric jsonMetric)
        {
            Metric = jsonMetric;
            if (string.IsNullOrEmpty(Metric.Group))
            {
                Dimensions = new string[] { };
            }
            else
            {
                Dimensions = Metric.Group.Split(',');
            }
            Aggregates = new Dictionary <string, Aggregate>();

            Total = AggregateFactory.Default.Get(Metric);
            AsOf  = MetricState.PeriodTime(Metric.Period);
        }
Exemple #2
0
        public MetricState LoadState()
        {
            while (RedisClient.Current.Database == null)
            {
                Thread.Sleep(10);
            }

            var state = GetState(MetricState.PeriodTime(Metric.Period));

            if (state != null)
            {
                return(state);
            }
            else
            {
                return(new MetricState(Name, Metric));
            }
        }
Exemple #3
0
 public string StateKey()
 {
     return(string.Format("{0}|{1}", MetricSortedListKey, MetricState.PeriodTime(Metric.Period)));
 }