/** * 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; }
/** * 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) { }
/** * 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; }
/** * Returns a copy of the monitor config with additional tags. */ public MonitorConfig withAdditionalTags(ITagList newTags) { return copy().withTags(newTags).build(); }
public AtlasMetrics(ITagList commonTags, IEnumerable<Metric> metrics) { this.tags = commonTags.AsDictionary(); this.metrics = BuildAtlasMetric(metrics); }