Returns a new monitor that adds the provided tags to the configuration returned by the
wrapped monitor.
555638
@SuppressWarnings("unchecked")
  static <T> Monitor<T> wrap(TagList tags, Monitor<T> monitor) {
    Monitor<T> m;
    if (monitor instanceof CompositeMonitor<?>) {
      m = new CompositeMonitorWrapper<>(tags, (CompositeMonitor<T>) monitor);
    } else {
      m = MonitorWrapper.create(tags, monitor);
    }
    return m;
  }
769614
def clone(self):
        
        return Monitor(org=self.org, app=self.app, env=self.env)
137228
ArrayTagSet add(String k, String v) {
    return add(new BasicTag(k, v));
  }
536695
def job_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTags' % object_id, input_params, always_retry=always_retry, **kwargs)
641617
public static Stopwatch start(String name, String... tags) {
    final MonitorConfig.Builder configBuilder = MonitorConfig.builder(name);
    Preconditions.checkArgument(tags.length % 2 == 0,
        "The sequence of (key, value) pairs must have even size: one key, one value");
    for (int i = 0; i < tags.length; i += 2) {
      configBuilder.withTag(tags[i], tags[i + 1]);
    }

    return INSTANCE.get(configBuilder.build(), TimeUnit.MILLISECONDS).start();
  }
872408
@SuppressWarnings("unchecked")
    public T addTag(String tag) {
        if (this.tags_ == null) {
            tags_ = new ArrayList<>();
        }
        this.tags_.add(tag);
        return (T) this;
    }
1126223
def add(self, visualization):
        
        res = self.es.create(index=self.index,
                             id=visualization.id or str(uuid.uuid1()),
                             doc_type=self.doc_type,
                             body=visualization.to_kibana(), refresh=True)
        return res
1240566
private static MonitorConfig newConfig(
      Class<?> c,
      String defaultName,
      String id,
      com.netflix.servo.annotations.Monitor anno,
      TagList tags) {
    String name = anno.name();
    if (name.isEmpty()) {
      name = defaultName;
    }
    MonitorConfig.Builder builder = MonitorConfig.builder(name);
    builder.withTag("class", className(c));
    builder.withTag(anno.type());
    builder.withTag(anno.level());
    if (tags != null) {
      builder.withTags(tags);
    }
    if (id != null) {
      builder.withTag("id", id);
    }
    return builder.build();
  }
1287955
public ItemRequest<Task> addTag(String task) {
    
        String path = String.format("/tasks/%s/addTag", task);
        return new ItemRequest<Task>(this, Task.class, path, "POST");
    }
324755
public PutPlaybackConfigurationResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
706651
def with_tag(key, value)
      new_tags = @tags.dup
      new_tags[key] = value
      MeterId.new(@name, new_tags)
    end
441126
def add_tags(host)
      host[:host_tags].merge(
          'beaker_version'    => Beaker::Version::STRING,
          'jenkins_build_url' => @options[:jenkins_build_url],
          'department'        => @options[:department],
          'project'           => @options[:project],
          'created_by'        => @options[:created_by],
          'name'              => host.name,
          'roles'             => host.host_hash[:roles].join(', ')
      )
    end
436546
static void addMonitors(List<Monitor<?>> monitors, String id, TagList tags, Object obj) {
    addMonitorFields(monitors, id, tags, obj);
    addAnnotatedFields(monitors, id, tags, obj);
  }
60569
def createMonitor(self, callback=None, errback=None, **kwargs):
        
        import ns1.monitoring
        monitor = ns1.monitoring.Monitor(self.config)
        return monitor.create(callback=callback, errback=errback, **kwargs)
1082590
public static Counter newCounter(String name, TaggingContext context) {
    final MonitorConfig config = MonitorConfig.builder(name).build();
    return new ContextualCounter(config, context, COUNTER_FUNCTION);
  }
1133755
def modify(self, monitor_id, options):
        """"""
        if not self._state:
            raise InvalidState("State was not properly obtained from the app")
        monitors = self.list()  # Get the latest set of monitors
        obj = None
        for monitor in monitors:
            if monitor_id != monitor['monitor_id']:
                continue
            obj = monitor
        if not monitor_id:
            raise MonitorNotFound("No monitor was found with that term.")
        options['action'] = 'MODIFY'
        options.update(obj)
        payload = self._build_payload(obj['term'], options)
        url = self.ALERTS_MODIFY_URL.format(requestX=self._state[3])
        self._log.debug("Modifying alert using: %s" % url)
        params = json.dumps(payload, separators=(',', ':'))
        data = {'params': params}
        response = self._session.post(url, data=data, headers=self.HEADERS)
        if response.status_code != 200:
            raise ActionError("Failed to create monitor: %s"
                              % response.content)
        return self.list()
893662
def applet_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTags' % object_id, input_params, always_retry=always_retry, **kwargs)