Ejemplo n.º 1
0
 /**
  * Add all tags in the list to the config.
  */
 public Builder withTags(ITagList tagList)
 {
     if (tagList != null)
     {
         foreach (var t in tagList)
         {
             tagsBuilder.add(t);
         }
     }
     return this;
 }
Ejemplo n.º 2
0
        /**
         * Creates a new instance.
         *
         * @param name      name of the metric
         * @param tags      tags associated with the metric
         * @param timestamp point in time when the metric value was sampled
         * @param value     value of the metric
         */
        public Metric(string name, ITagList tags, long timestamp, Object value)
            : this(new MonitorConfig.Builder(name).withTags(tags).build(), timestamp, value)
        {

        }
Ejemplo n.º 3
0
 /**
  * Creates a new instance with a given name and tags. If {@code tags} is
  * null an empty tag list will be used.
  */
 private MonitorConfig(Builder builder)
 {
     this.name = builder.name;
     this.tags = (builder.tagsBuilder.isEmpty())
         ? BasicTagList.EMPTY
         : new BasicTagList(builder.tagsBuilder.result());
     this.policy = builder.policy;
 }
Ejemplo n.º 4
0
 /**
  * Returns a copy of the monitor config with additional tags.
  */
 public MonitorConfig withAdditionalTags(ITagList newTags)
 {
     return copy().withTags(newTags).build();
 }
Ejemplo n.º 5
0
        public AtlasMetrics(ITagList commonTags, IEnumerable<Metric> metrics)
        {
            this.tags = commonTags.AsDictionary();

            this.metrics = BuildAtlasMetric(metrics);
        }