Performs monitoring across the board.

@return
For all the computers, report the monitored values.
434272
protected Map<Computer,T> monitor() throws InterruptedException {
        Map<Computer,T> data = new HashMap<>();
        for( Computer c : Jenkins.getInstance().getComputers() ) {
            try {
                Thread.currentThread().setName("Monitoring "+c.getDisplayName()+" for "+getDisplayName());

                if(c.getChannel()==null)
                    data.put(c,null);
                else
                    data.put(c,monitor(c));
            } catch (RuntimeException | IOException e) {
                LOGGER.log(Level.WARNING, "Failed to monitor "+c.getDisplayName()+" for "+getDisplayName(), e);
            } catch (InterruptedException e) {
                throw (InterruptedException)new InterruptedException("Node monitoring "+c.getDisplayName()+" for "+getDisplayName()+" aborted.").initCause(e);
            }
        }
        return data;
    }
308391
@Override
    public void run()
    {
        m_taskQueue.offer(this);
        // check if previous task is running for more than threshold
        SiteTasker task = m_taskQueue.peek();
        long currentTime = System.nanoTime();
        long headOfQueueOfferTime;
        if (task != null) {
            headOfQueueOfferTime = task.getQueueOfferTime();
        } else {
            headOfQueueOfferTime = currentTime;
        }
        if (headOfQueueOfferTime != m_previousTaskTimestamp) {
            m_previousTaskTimestamp = headOfQueueOfferTime;
            m_previousTaskPeekTime = currentTime;
        } else if (currentTime - m_previousTaskPeekTime >= m_procedureLogThreshold) {
            long waitTime = (currentTime - m_previousTaskPeekTime)/1_000_000_000L; // in seconds
            if (m_logger.isDebugEnabled()) {
                String taskInfo = (task == null) ? "" : " Task Info: " + task.getTaskInfo();
                m_logger.rateLimitedLog(SUPPRESS_INTERVAL, Level.DEBUG, null, TICK_MESSAGE + taskInfo, waitTime, m_partitionId);
            } else {
                m_logger.rateLimitedLog(SUPPRESS_INTERVAL, Level.INFO, null, TICK_MESSAGE, waitTime, m_partitionId);
            }
        }
    }
880886
public List<T> allResults() {
        List<T> results = null;
        if (response != null && response.size() > 0) {
            // We first calculate the total size needed
            int totalSize = allResultsSize();

            // We init the list and copy data
            results = new ArrayList<>(totalSize);
            for (QueryResult<T> queryResult : response) {
                results.addAll(queryResult.getResult());
            }
        }
        return results;
    }
485969
private void monitorForChanges() {
        if (monitorRunning) {
            return;
        }

        final Path path;
        try {
            path = Paths.get(configPath);
        } catch (final Exception e) {
            LOGGER.warn("Cannot monitor configuration {}, disabling monitoring; {}", configPath, e.getMessage());
            return;
        }

        if (!path.toFile().exists()) {
            LOGGER.debug("Configuration {} does not exist, disabling monitoring", configPath);
            return;
        }
        final Path directoryPath = path.getParent();

        try {
            final WatchService watchService = FileSystems.getDefault().newWatchService();
            directoryPath.register(watchService, ENTRY_MODIFY);

            monitorThread = new Thread(new Runnable() {

                @Override
                public void run() {
                    try {
                        for (;;) {
                            final WatchKey key;
                            try {
                                key = watchService.take();
                            } catch (final InterruptedException e) {
                                LOGGER.debug("Interrupted the configuration monitor thread.");
                                break;
                            }

                            for (final WatchEvent<?> event : key.pollEvents()) {
                                final WatchEvent.Kind<?> kind = event.kind();
                                if (kind == OVERFLOW) {
                                    continue;
                                }

                                // If the configuration file triggered this event, reload it
                                final Path changed = (Path) event.context();
                                if (changed.equals(path.getFileName())) {
                                    LOGGER.info(
                                            "Configuration {} has been updated, reloading.",
                                            path);
                                    try {
                                        loadConfiguration();
                                    } catch (final IOException e) {
                                        LOGGER.error("Failed to reload configuration {}", configPath, e);
                                    }
                                }

                                // reset the key
                                final boolean valid = key.reset();
                                if (!valid) {
                                    LOGGER.debug("Monitor of {} is no longer valid", path);
                                    break;
                                }
                            }
                        }
                    } finally {
                        try {
                            watchService.close();
                        } catch (final IOException e) {
                            LOGGER.error("Failed to stop configuration monitor", e);
                        }
                    }
                    monitorRunning = false;
                }
            });
        } catch (final IOException e) {
            LOGGER.error("Failed to start configuration monitor", e);
        }

        monitorThread.start();
        monitorRunning = true;
    }
28950
public void report() {
        synchronized (this) {
            report(registry.getGauges(filter),
                    registry.getCounters(filter),
                    registry.getHistograms(filter),
                    registry.getMeters(filter),
                    registry.getTimers(filter));
        }
    }
924393
public Result run(Computer computer, Class<?>... classes) {
        return run(Request.classes(computer, classes));
    }
1072506
public Page<MonitoredResourceDescriptor> listMonitoredResourceDescriptors() {
    // [START listMonitoredResourceDescriptors]
    Page<MonitoredResourceDescriptor> descriptors =
        logging.listMonitoredResourceDescriptors(ListOption.pageSize(100));
    for (MonitoredResourceDescriptor descriptor : descriptors.iterateAll()) {
      // do something with the descriptor
    }
    // [END listMonitoredResourceDescriptors]
    return descriptors;
  }
169042
public Computer[] getComputers() {
        Computer[] r = computers.values().toArray(new Computer[0]);
        Arrays.sort(r,new Comparator<Computer>() {
            @Override public int compare(Computer lhs, Computer rhs) {
                if(lhs.getNode()==Jenkins.this)  return -1;
                if(rhs.getNode()==Jenkins.this)  return 1;
                return lhs.getName().compareTo(rhs.getName());
            }
        });
        return r;
    }
1130341
public synchronized boolean startMonitor() {
        if (this.executor != null) {
            if (this.monitorHandle == null) {
                this.monitorHandle = this.executor.scheduleWithFixedDelay(this.monitor, this.monitorInterval, this.monitorInterval, TimeUnit.MILLISECONDS);
            }
            return true;
        }
        return false;
    }
207468
public function performAllChecks() {
    $this->checkRequire();
    $this->checkBltRequireDev();
    if (!$this->getInspector()->isVmCli()) {
      $this->checkPrestissimo();
    }
    $this->checkComposerConfig();

    return $this->problems;
  }
713014
protected String startMonitoring() {
        String result;
        if ( ! this.started.getAndSet(true) ) {
            synchronized ( this.brokerPollerMap ) {
                for (ActiveMQBrokerPoller onePoller : this.brokerPollerMap.values()) {
                    onePoller.start();
                }
            }

            result = "started";
        } else {
            result = "already running";
        }
        return result;
    }
1303382
public DuplicationReport monitorDuplication() {
        log.info("starting duplication monitor");
        DuplicationReport report = new DuplicationReport();

        for (String host : dupHosts.keySet()) {
            DuplicationInfo info = new DuplicationInfo(host);
            try {
                // Connect to storage providers
                ContentStoreManager storeManager = getStoreManager(host);
                ContentStore primary = storeManager.getPrimaryContentStore();
                String primaryStoreId = primary.getStoreId();
                List<ContentStore> secondaryList =
                    getSecondaryStores(storeManager, primaryStoreId);

                // Get primary space listing and count
                List<String> primarySpaces = getSpaces(host, primary);
                countSpaces(host, info, primary, primarySpaces, true);

                // Get space listing and space counts for secondary providers
                for (ContentStore secondary : secondaryList) {
                    List<String> secondarySpaces = getSpaces(host, secondary);
                    if (primarySpaces.size() != secondarySpaces.size()) {
                        info.addIssue("The spaces listings do not match " +
                                      "between primary and secondary " +
                                      "provider: " +
                                      secondary.getStorageProviderType());
                    }
                    // Determine item count for secondary provider spaces
                    countSpaces(host, info, secondary, secondarySpaces, false);
                }

                // Compare the space counts between providers
                compareSpaces(primaryStoreId, info);
            } catch (Exception e) {
                String error = e.getClass() + " exception encountered while " +
                               "running dup monitor for host " + host +
                               ". Exception message: " + e.getMessage();
                log.error(error);
                info.addIssue(error);
            } finally {
                report.addDupInfo(host, info);
            }
        }

        return report;
    }
159727
public List<TaskMonitor> getTaskMonitors(RuntimeContext context) {
        return getTaskMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
437836
public java.util.List<TrustedAdvisorCheckRefreshStatus> getStatuses() {
        if (statuses == null) {
            statuses = new com.amazonaws.internal.SdkInternalList<TrustedAdvisorCheckRefreshStatus>();
        }
        return statuses;
    }
595343
def monitor(self):
        """"""
        if self._monitor_api is None:
            self._monitor_api = self.get_monitor_api()
        return self._monitor_api
186705
@SuppressWarnings("unchecked")
  public T compareAll() {
    this.compareInputFormat().compareOutputFormat().compareIsCompressed().compareIsStoredAsSubDirs().compareNumBuckets()
        .compareBucketCols().compareRawLocation().compareParameters();
    return (T) this;
  }
1191080
def check_monitoring
      @servers.each do |server|
        server.settings
        response = nil
        count = 0
        until response || count > 20 do
          begin
            response = server.monitoring
          rescue
            response = nil
            count += 1
            sleep 10
          end
        end
        raise "Fatal: Failed to verify that monitoring is operational" unless response
#TODO: pass in some list of plugin info to check multiple values.  For now just
# hardcoding the cpu check
        sleep 60 # This is to allow monitoring data to accumulate
        monitor=server.get_sketchy_data({'start'=>-60,'end'=>-20,'plugin_name'=>"cpu-0",'plugin_type'=>"cpu-idle"})
        idle_values = monitor['data']['value']
        raise "No cpu idle data" unless idle_values.length > 0
        raise "No idle time" unless idle_values[0] > 0
        puts "Monitoring is OK for #{server.nickname}"
      end
    end