Converts a spectator id into a MonitorConfig that can be used by servo.
335718
MonitorConfig toMonitorConfig(Id id, Tag stat) {
    MonitorConfig.Builder builder = new MonitorConfig.Builder(id.name());
    if (stat != null) {
      builder.withTag(stat.key(), stat.value());
    }
    for (Tag t : id.tags()) {
      builder.withTag(t.key(), t.value());
    }
    return builder.build();
  }
61775
def _format_monitor_parameter(param):
        
        if '{' in param and '}':
            tmp = param.strip('}').split('{')
            monitor = ''.join(tmp).rstrip()
            return monitor
        else:
            return param
234946
private function _loadObservers()
  {
    $class = $this->name();
    $name = self::_configName($class);
    $config = Config::getInstance($name);
    
    $this->_observers = $config->valueOf();
  }
698642
public void unregisterMonitor(Monitor monitor) {
        if (monitors != null) {
            monitors.remove(monitor);
            if (monitors.isEmpty()) {
                monitors = null;
            }
        }
    }
174189
function startWatchIPCServer(callback, configIndices) {
        ipc.config.id = serverName;
        ipc.config.retry = 3;
        ipc.config.silent = true;

        ipc.serve(
            function() {
                ipc.server.on(
                    'done',
                    watchDoneHandler.bind(this, callback, ipc, configIndices)
                );
            }
        );
        ipc.server.start();
    }
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();
  }
1043577
protected M getMonitorForCurrentContext() {
    MonitorConfig contextConfig = getConfig();
    M monitor = monitors.get(contextConfig);
    if (monitor == null) {
      M newMon = newMonitor.apply(contextConfig);
      if (newMon instanceof SpectatorMonitor) {
        ((SpectatorMonitor) newMon).initializeSpectator(spectatorTags);
      }
      monitor = monitors.putIfAbsent(contextConfig, newMon);
      if (monitor == null) {
        monitor = newMon;
      }
    }
    return monitor;
  }
789918
def make_key(observer):
        """"""

        if hasattr(observer, "__self__"):
            inst = observer.__self__
            method_name = observer.__name__
            key = (id(inst), method_name)
        else:
            key = id(observer)
        return key
43474
protected void doConvert(IProject project, IProgressMonitor monitor) throws ExecutionException {
		monitor.setTaskName(MessageFormat.format(Messages.RemoveSarlNatureHandler_2, project.getName()));
		final SubMonitor mon = SubMonitor.convert(monitor, 2);
		if (this.configurator.canUnconfigure(project, mon.newChild(1))) {
			try {
				this.configurator.unconfigure(project, mon.newChild(1));
			} catch (CoreException exception) {
				throw new ExecutionException(exception.getLocalizedMessage(), exception);
			}
		}
		monitor.done();
	}
975358
def deleteMonitorById(self, monitorID):
        
        url = self.baseUrl
        url += "deleteMonitor?apiKey=%s" % self.apiKey
        url += "&monitorID=%s" % monitorID
        url += "&noJsonCallback=1&format=json"
        success, response = self.requestApi(url)
        if success:
            return True
        else:
            return False
896459
function(type, handler) {
		var id = type.$instanceid;
		var obs = this._observers;
		var handlers = obs[id] || (obs[id] = []);
		if (handlers.indexOf(handler) === -1) {
			handlers.push(handler);
		}
		return type;
	}
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()
1262815
def update_monitor(self):
        """"""
        result = self._client.get_state(self._monitor_url)
        self._raw_result = result['monitor']
1029476
private void addConsumerToRegisteredMonitorMap(
    MonitoredConsumer mc,
    ArrayList monitorList,
    Map registeredMonitors)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(
          tc,
          "addConsumerToRegisteredMonitorMap",
          new Object[] { registeredMonitors,
                         mc,
                         monitorList });
    // Finally, add this consumer to the appropriate places in the registered
    // consumer monitors tables
    Iterator i = monitorList.iterator();
    while (i.hasNext())
    {
      String tExpr = (String)i.next();

      // Get the next monitor
      RegisteredCallbacks rMonitor = (RegisteredCallbacks)registeredMonitors.get(tExpr);

      // Retrieve the current list of consumers
      ArrayList matchingConsumerList = rMonitor.getMatchingConsumers();

      // There is no need to drive any callbacks as we are placing subscriptions
      // in the registrations table that correspond to existing subscriptions.
      // So simply add the new subscription to the list.
      matchingConsumerList.add(mc);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addConsumerToRegisteredMonitorMap");

  }
31
def monitor(self):
        
        if self._monitor is None:
            from twilio.rest.monitor import Monitor
            self._monitor = Monitor(self)
        return self._monitor
422237
def viewers(self, value):
        
        warnings.warn(
            _ASSIGNMENT_DEPRECATED_MSG.format("viewers", VIEWER_ROLE),
            DeprecationWarning,
        )
        self[VIEWER_ROLE] = value
1185539
public void monitorEnter(Local<?> monitor) {
        addInstruction(new ThrowingInsn(Rops.MONITOR_ENTER, sourcePosition,
                RegisterSpecList.make(monitor.spec()), catches));
    }