예제 #1
0
        public Histogram(IBucket[] buckets, string help, string name, string[] labelNames, string[] labels)
        {
            if (!IsValidName(name))
            {
                throw new ArgumentException($"Invalid metric name: {name}");
            }

            this.name       = name;
            this.help       = help;
            this.labels     = labels;
            this.labelNames = labelNames;
            this.buckets    = buckets.Select(b => new Bucket(b)).ToArray();

            this.maxValues = buckets.Select(b => b.Max).ToArray();
            this.sum       = new AtomicDouble();
        }