Example #1
0
        public Metric get_metric(MetricsFinder metrics_finder)
        {
            if (metrics_finder.empty())
            {
                return(null);
            }

            List <string> keys_to_add = new List <string>();
            List <KeyValuePair <string, string> > dims = new List <KeyValuePair <string, string> >();
            Metric        last_node = null;
            MetricsFinder mf        = metrics_finder;

            lock (mutex_)
            {
                if (metrics_.ContainsKey(metrics_finder.Cannon()))
                {
                    var metric = metrics_[metrics_finder.Cannon()];
                    if (metric != null)
                    {
                        return(metric);
                    }
                }

                while (!mf.empty())
                {
                    if (metrics_.ContainsKey(mf.Cannon()))
                    {
                        last_node = metrics_[mf.Cannon()];
                    }

                    keys_to_add.Add(mf.Cannon());
                    dims.Add(mf.last_dimension());
                    mf.PopDimension();
                }

                for (int i = dims.Count - 1; i >= 0; i--)
                {
                    var m = new Metric(last_node, dims[i]);
                    last_node = m;
                    metrics_.Add(keys_to_add[i], m);
                }
            }
            return(last_node);
        }
Example #2
0
 public override Metric get_metric(MetricsFinder finder)
 {
     return(dummy);
 }
Example #3
0
 public virtual Metric get_metric(MetricsFinder finder)
 {
     return(metrics_index.get_metric(finder));
 }