Runs report metrics command.

@return 0 on success, 1 otherwise
507035
public int run() throws IOException {
    mMetricsMap = new TreeMap<>(mMetaMasterClient.getMetrics());
    Long bytesReadLocal =
        mMetricsMap.getOrDefault(MetricsSystem.getClusterMetricName(ClientMetrics.BYTES_READ_LOCAL),
            MetricValue.newBuilder().setLongValue(0L).build()).getLongValue();
    Long bytesReadRemote = mMetricsMap
        .getOrDefault(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_ALLUXIO),
            MetricValue.newBuilder().setLongValue(0L).build())
        .getLongValue();
    Long bytesReadUfs = mMetricsMap
        .getOrDefault(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_UFS_ALL),
            MetricValue.newBuilder().setLongValue(0L).build())
        .getLongValue();

    mPrintStream.println("Total IO: ");
    printMetric(MetricsSystem.getClusterMetricName(ClientMetrics.BYTES_READ_LOCAL),
        "Short-circuit Read", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_ALLUXIO),
        "From Remote Instances", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_UFS_ALL),
        "Under Filesystem Read", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_WRITTEN_ALLUXIO),
        "Alluxio Write", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_WRITTEN_UFS_ALL),
        "Under Filesystem Write", true);

    mPrintStream.println("\nTotal IO Throughput (Last Minute): ");
    printMetric(MetricsSystem.getClusterMetricName(ClientMetrics.BYTES_READ_LOCAL_THROUGHPUT),
        "Short-circuit Read", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_ALLUXIO_THROUGHPUT),
        "From Remote Instances", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_READ_UFS_THROUGHPUT),
        "Under Filesystem Read", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_WRITTEN_ALLUXIO_THROUGHPUT),
        "Alluxio Write", true);
    printMetric(MetricsSystem.getClusterMetricName(WorkerMetrics.BYTES_WRITTEN_UFS_THROUGHPUT),
        "Under Filesystem Write", true);

    mPrintStream.println("\nCache Hit Rate (Percentage): ");
    long bytesReadTotal = bytesReadLocal + bytesReadRemote + bytesReadUfs;
    String cacheHitLocalPercentage = String.format("%.2f",
        (bytesReadTotal > 0) ? (100D * bytesReadLocal / bytesReadTotal) : 0);
    String cacheHitRemotePercentage = String.format("%.2f",
        (bytesReadTotal > 0) ? (100D * bytesReadRemote / bytesReadTotal) : 0);
    String cacheMissPercentage = String.format("%.2f",
        (bytesReadTotal > 0) ? (100D * bytesReadUfs / bytesReadTotal) : 0);

    mPrintStream.println(INDENT
        + String.format(mInfoFormat, "Alluxio Local", cacheHitLocalPercentage));
    mPrintStream.println(INDENT
        + String.format(mInfoFormat, "Alluxio Remote", cacheHitRemotePercentage));
    mPrintStream.println(INDENT
        + String.format(mInfoFormat, "Miss", cacheMissPercentage));

    mPrintStream.println("\nLogical Operations: ");
    printMetric(MasterMetrics.DIRECTORIES_CREATED, "Directories Created", false);
    printMetric(MasterMetrics.FILE_BLOCK_INFOS_GOT, "File Block Infos Got", false);
    printMetric(MasterMetrics.FILE_INFOS_GOT, "File Infos Got", false);
    printMetric(MasterMetrics.FILES_COMPLETED, "Files Completed", false);
    printMetric(MasterMetrics.FILES_CREATED, "Files Created", false);
    printMetric(MasterMetrics.FILES_FREED, "Files Freed", false);
    printMetric(MasterMetrics.FILES_PERSISTED, "Files Persisted", false);
    printMetric(MasterMetrics.NEW_BLOCKS_GOT, "New Blocks Got", false);
    printMetric(MasterMetrics.PATHS_DELETED, "Paths Deleted", false);
    printMetric(MasterMetrics.PATHS_MOUNTED, "Paths Mounted", false);
    printMetric(MasterMetrics.PATHS_RENAMED, "Paths Renamed", false);
    printMetric(MasterMetrics.PATHS_UNMOUNTED, "Paths Unmounted", false);

    mPrintStream.println("\nRPC Invocations: ");
    printMetric(MasterMetrics.COMPLETE_FILE_OPS, "Complete File Operations", false);
    printMetric(MasterMetrics.CREATE_DIRECTORIES_OPS, "Create Directory Operations", false);
    printMetric(MasterMetrics.CREATE_FILES_OPS, "Create File Operations", false);
    printMetric(MasterMetrics.DELETE_PATHS_OPS, "Delete Path Operations", false);
    printMetric(MasterMetrics.FREE_FILE_OPS, "Free File Operations", false);
    printMetric(MasterMetrics.GET_FILE_BLOCK_INFO_OPS, "Get File Block Info Operations", false);
    printMetric(MasterMetrics.GET_FILE_INFO_OPS, "Get File Info Operations", false);
    printMetric(MasterMetrics.GET_NEW_BLOCK_OPS, "Get New Block Operations", false);
    printMetric(MasterMetrics.MOUNT_OPS, "Mount Operations", false);
    printMetric(MasterMetrics.RENAME_PATH_OPS, "Rename Path Operations", false);
    printMetric(MasterMetrics.SET_ACL_OPS, "Set ACL Operations", false);
    printMetric(MasterMetrics.SET_ATTRIBUTE_OPS, "Set Attribute Operations", false);
    printMetric(MasterMetrics.UNMOUNT_OPS, "Unmount Operations", false);

    // TODO(lu) improve printout info to sync with web UI
    mPrintStream.println("\nOther Metrics: ");
    mInfoFormat = "%s  (%s)"; // Some property names are too long to fit in previous info format
    for (Map.Entry<String, MetricValue> entry : mMetricsMap.entrySet()) {
      mPrintStream.println(INDENT + String.format(mInfoFormat,
          entry.getKey(), getFormattedValue(entry.getValue())));
    }
    return 0;
  }
723421
protected function run()
    {
        $report = common_report_Report::createInfo('Deleting Failing deliveries');

        /** @var ComplexSearchService $search */
        $search = $this->getModel()->getSearchInterface();
        $deliveryAssemblyService = DeliveryAssemblyService::singleton();

        $queryBuilder = $search->query();
        $query = $search->searchType($queryBuilder, $deliveryAssemblyService->getRootClass()->getUri(),true);
        $queryBuilder->setCriteria($query);
        $searchResult = $search->getGateway()->search($queryBuilder);

        $failedDeliveries = [];
        /** @var \core_kernel_classes_Resource $instance */
        foreach ($searchResult as $instance) {
            try {
                $value = DeliveryAssemblyService::singleton()->getRuntime($instance);
                if (is_null($value)) {
                    $failedDeliveries[] = $instance;
                }
            } catch (\common_Exception $e) {
                $failedDeliveries[] = $instance;
            }
        }

        /** @var \core_kernel_classes_Resource $failedDelivery */
        foreach ($failedDeliveries as $failedDelivery) {
            $failedDelivery->delete(true);
            $report->add(common_report_Report::createSuccess('Delivery deleted:'. $failedDelivery->getUri()));
        }

        return $report;
    }
1131776
public static function run(): int {
            $startOfRun = microtime(true);
            $testDurationInMicroseconds = 0;

            $reporter = new ConsoleReporter;
            $reporter->setMaxEntries(static::$numberOfTest);
            $reporter->doNotClearProgress();
            $reporter->displaySeverityWithIcons();
            $reporter->setProgressBarSize(36);
            
            $currentDescriptionIndex = 1;
            $lastDescription = false;
            $lastTest = false;

            $completedTests = 0;
            $failedTests = 0;

            foreach( static::$tests as $description => $tests ) {
                if( static::allowedToReportDescription() === true ) {
                    $reporter->info("Running tests for \"$description\"");
                }

                $lastDescription = $currentDescriptionIndex === count(static::$tests);

                $currentTestIndex = 1;

                foreach( $tests as $expectedBehaviorString => $callableTest ) {
                    $startOfTest = microtime(true);
                    
                    try {
                        $lastTest = $currentTestIndex === count($tests);

                        $currentTestIndex++;

                        call_user_func($callableTest);

                        if( static::$reportLevel === ReportLevel::DETAILED ) {
                            $reporter->success('"it ' . $expectedBehaviorString . '" completed');
                        }

                        $completedTests++;
                    }
                    catch( TestFailedException $exception ) {
                        if( static::allowedToReportTestFailed() === true ) {
                            $reporter->error('"it ' . $expectedBehaviorString . '" failed');
                            $reporter->error($exception->getMessage());
                        }

                        $failedTests++;
                    }
                    finally {
                        $endOfTest = microtime(true);
                        $testDurationInMicroseconds += $endOfTest - $startOfTest;

                        if( $lastDescription === true && $lastTest === true ) {
                            $endOfRun = microtime(true);
                            $totalRunTimeInMicroseconds = $endOfRun - $startOfRun;
                            $extraRunTimeInMicoseconds  = round($totalRunTimeInMicroseconds - $testDurationInMicroseconds, 4);
                            $testDurationInMicroseconds = round($testDurationInMicroseconds, 4);

                            $reporter->debug("$completedTests tests completed, $failedTests tests failed");                            

                            if( static::allowedToReportElapsedTime() === true ) {
                                $reporter->debug("tests ran in $testDurationInMicroseconds sec. (+$extraRunTimeInMicoseconds sec.)");       
                            }
                        }

                        $reporter->report();
                        $reporter->advance();
                    }
                }

                $currentDescriptionIndex++;
            }

            if( $failedTests > 0 ) {
                return 1;
            }
            else {
                return 0;
            }
        }
409473
public String run()
    {
		String locale = getLocale().getLanguage();

		SystemUnderTest sut = SystemUnderTest.newInstance(sutName);
		sut.setProject(Project.newInstance(sutProjectName));
		sut.setRunner(Runner.newInstance(""));

		Specification spec = Specification.newInstance(getPage().getTitle());

		try
		{
			spec.setRepository(gpUtil.getHomeRepository(spaceKey));

        	execution = gpUtil.getGPServerService().runSpecification(sut, spec, implemented, locale);
        } 
        catch (GreenPepperServerException e) 
        {
            execution = Execution.error(spec, sut, null, e.getId());
        }
        catch (Exception e) 
        {
            execution = Execution.error(spec, sut, null, ExceptionUtils.stackTrace(e, "<br>", 15));
        }
        
        return SUCCESS;
    }
563051
public java.util.List<MetricDataResult> getMetricDataResults() {
        if (metricDataResults == null) {
            metricDataResults = new com.amazonaws.internal.SdkInternalList<MetricDataResult>();
        }
        return metricDataResults;
    }
313384
@SuppressWarnings({ "rawtypes", "unchecked" })
	public void run()
	{
		IProcess process = fConsole.getProcess();
		if (process != null)
		{
			List targets = collectTargets(process);
			targets.add(process);
			DebugCommandService service = DebugCommandService.getService(fWindow);
			service.executeCommand(ITerminateHandler.class, targets.toArray(), null);
		}
	}
1303182
public boolean run(I_CmsReport report, CmsSiteManagerImpl siteManager) {

        synchronized (LOCK) {
            // *not* using getAvailable sites here, because the result does not include sites with unpublished site folders if called with a CmsObject in the Online project
            // Instead we use getSites() and avoid duplicates using an IdentityHashMap
            IdentityHashMap<CmsSite, CmsSite> siteIdMap = new IdentityHashMap<CmsSite, CmsSite>();
            for (CmsSite site : siteManager.getSites().values()) {
                if (site.getSSLMode() == CmsSSLMode.LETS_ENCRYPT) {
                    siteIdMap.put(site, site);
                }
            }
            List<CmsSite> sites = Lists.newArrayList(siteIdMap.values());
            List<String> workplaceServers = siteManager.getWorkplaceServers(CmsSSLMode.LETS_ENCRYPT);
            return run(report, sites, workplaceServers);
        }
    }
1062824
@Override
    public synchronized void run() {

        try {
            // do the rename operation
            m_mergePages.actionMerge(getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
    }
1338633
@Override
	public final void run() {

		LOGGER.debug("Executing " + getClass().getSimpleName());
		markAsInProgress();

		if (!Lists.isNullOrEmpty(listeners)) {
			Runnable startUseCaseRunnable = new Runnable() {
				@Override
				public void run() {
					for (UseCaseListener listener : listeners) {
						notifyUseCaseStart(listener);
					}
				}
			};
			if (handler != null) {
				handler.post(startUseCaseRunnable);
			} else {
				startUseCaseRunnable.run();
			}
		}

		Trace trace = null;
		if (timingTrackingEnabled()) {
			trace = TraceHelper.startTrace(getClass());
		}

		try {

			LOGGER.debug("Started " + getClass().getSimpleName());
			executionTime = null;
			startTime = DateUtils.nowMillis();
			doExecute();
			executionTime = DateUtils.nowMillis() - startTime;
			LOGGER.debug("Finished " + getClass().getSimpleName() + ". Execution time: " + DateUtils.formatDuration(executionTime));

			if (trace != null) {
				trace.putAttribute("result", "success");
				trace.incrementMetric("successes", 1);
			}

			markAsSuccessful();

			if (!Lists.isNullOrEmpty(listeners)) {
				Runnable finishedUseCaseRunnable = new Runnable() {
					@Override
					public void run() {
						for (UseCaseListener listener : listeners) {
							notifyFinishedUseCase(listener);
						}
						markAsNotified();
					}
				};
				if (handler != null) {
					handler.post(finishedUseCaseRunnable);
				} else {
					finishedUseCaseRunnable.run();
				}
			}

		} catch (RuntimeException e) {
			if (trace != null) {
				trace.putAttribute("result", "failure");
				trace.incrementMetric("failures", 1);
			}
			final AbstractException abstractException = wrapException(e);
			markAsFailed(abstractException);
			logHandledException(abstractException);

			if (!Lists.isNullOrEmpty(listeners)) {
				Runnable finishedFailedUseCaseRunnable = new Runnable() {
					@Override
					public void run() {
						for (UseCaseListener listener : listeners) {
							notifyFailedUseCase(abstractException, listener);
						}
						markAsNotified();
					}
				};
				if (handler != null) {
					handler.post(finishedFailedUseCaseRunnable);
				} else {
					finishedFailedUseCaseRunnable.run();
				}
			}
		} finally {
			if (trace != null) {
				trace.stop();
			}
		}
	}
805115
def report(self):
        

        # We need only the first 4 significant digits
        tt = (str(self._endtime - self._starttime))[:4]

        self.log('\n%s finished in %s seconds.' % (__pkg_name__, tt))
        self.log('%d directories parsed, %d files copied' %
                 (self._numdirs, self._numfiles))
        if self._numdelfiles:
            self.log('%d files were purged.' % self._numdelfiles)
        if self._numdeldirs:
            self.log('%d directories were purged.' % self._numdeldirs)
        if self._numnewdirs:
            self.log('%d directories were created.' % self._numnewdirs)
        if self._numupdates:
            self.log('%d files were updated by timestamp.' % self._numupdates)

        # Failure stats
        self.log('')
        if self._numcopyfld:
            self.log('there were errors in copying %d files.'
                     % self._numcopyfld)
        if self._numdirsfld:
            self.log('there were errors in creating %d directories.'
                     % self._numdirsfld)
        if self._numupdsfld:
            self.log('there were errors in updating %d files.'
                     % self._numupdsfld)
        if self._numdeldfld:
            self.log('there were errors in purging %d directories.'
                     % self._numdeldfld)
        if self._numdelffld:
            self.log('there were errors in purging %d files.'
                     % self._numdelffld)
1299063
protected function run()
    {
        $this->kvStorage = $this->getCurrentKvResultStorage();

        $this->rdsStorage = $this->getServiceLocator()->get(RdsResultStorage::SERVICE_ID);

        $this->report = \common_report_Report::createInfo('Starting migration...');

        foreach ($this->kvStorage->getAllCallIds() as $callId) {
            foreach ($this->kvStorage->getVariables($callId) as $variables) {
                $this->migrateDeliveryExecution($callId, $variables);
            }
        }

        $this->setCurrentResultStorageToRdsStorage();

        $this->report->add(\common_report_Report::createSuccess(count($this->deliveryExecutions) . ' delivery executions migrated.'));
        if ($this->isDryrun()) {
            $this->report->add(\common_report_Report::createFailure(
                'The migration has not been applied because of dryrun mode. Use --wet-run to really run the migration'
            ));
        }
        return $this->report;
    }
951743
def run(self):
        
        elapsed = 0
        run_time = self.config['run_time']
        start_time = time.time()
        t = time.time
        self.turrets_manager.start(self.transaction_context)
        self.started = True

        while elapsed <= run_time:
            try:
                self._run_loop_action()
                self._print_status(elapsed)
                elapsed = t() - start_time
            except (Exception, KeyboardInterrupt):
                print("\nStopping test, sending stop command to turrets")
                self.turrets_manager.stop()
                self.stats_handler.write_remaining()
                traceback.print_exc()
                break

        self.turrets_manager.stop()
        print("\n\nProcessing all remaining messages... This could take time depending on message volume")
        t = time.time()
        self.result_collector.unbind(self.result_collector.LAST_ENDPOINT)
        self._clean_queue()
        print("took %s" % (time.time() - t))
929420
public static MetricInfo computeAllMetrics() {
        long start = System.currentTimeMillis();
        MetricInfo metricInfo = MetricUtils.mkMetricInfo();

        List<Map.Entry<String, AsmMetric>> entries = Lists.newLinkedList();
        if (enableStreamMetrics) {
            entries.addAll(streamMetrics.metrics.entrySet());
        }
        entries.addAll(taskMetrics.metrics.entrySet());
        entries.addAll(componentMetrics.metrics.entrySet());
        entries.addAll(compStreamMetrics.metrics.entrySet());
        entries.addAll(workerMetrics.metrics.entrySet());
        entries.addAll(nettyMetrics.metrics.entrySet());
        entries.addAll(topologyMetrics.metrics.entrySet());

        for (Map.Entry<String, AsmMetric> entry : entries) {
            String name = entry.getKey();
            AsmMetric metric = entry.getValue();

            // skip disabled metrics, double check
            if (disabledMetricNames.contains(metric.getShortName())) {
                continue;
            }
            Map<Integer, AsmSnapshot> snapshots = metric.getSnapshots();
            if (snapshots.size() == 0) {
                continue;
            }

            int op = metric.getOp();
            if ((op & AsmMetric.MetricOp.LOG) == AsmMetric.MetricOp.LOG) {
                MetricUtils.printMetricSnapshot(metric, snapshots);
            }

            if ((op & AsmMetric.MetricOp.REPORT) == AsmMetric.MetricOp.REPORT) {
                MetaType metaType = MetricUtils.metaType(metric.getMetricName());
                try {
                    if (metric instanceof AsmCounter) {
                        Map data = MetricUtils.toThriftCounterSnapshots(snapshots);
                        putIfNotEmpty(metricInfo.get_metrics(), name, data);
                    } else if (metric instanceof AsmGauge) {
                        Map data = MetricUtils.toThriftGaugeSnapshots(snapshots);
                        putIfNotEmpty(metricInfo.get_metrics(), name, data);
                    } else if (metric instanceof AsmMeter) {
                        Map data = MetricUtils.toThriftMeterSnapshots(snapshots);
                        putIfNotEmpty(metricInfo.get_metrics(), name, data);
                    } else if (metric instanceof AsmHistogram) {
                        Map data = MetricUtils.toThriftHistoSnapshots(metaType, snapshots);
                        putIfNotEmpty(metricInfo.get_metrics(), name, data);
                    }
                } catch (Exception ex) {
                    LOG.error("Error", ex);
                }
            }
        }

        if (debug) {
            MetricUtils.printMetricInfo(metricInfo, debugMetricNames);
        }
        LOG.debug("compute all metrics, cost:{}", System.currentTimeMillis() - start);
        return metricInfo;
    }
650196
public function runQueue()
    {
        $count = 0;
        $statistics = array();
        $queue = $this->getServiceManager()->get(Queue::CONFIG_ID);
        $report = new Report(Report::TYPE_SUCCESS);
        $limit = $this->getLimit();
        foreach ($queue as $task) {
            $subReport = $queue->runTask($task);
            $statistics[$subReport->getType()] = isset($statistics[$subReport->getType()])
            ? $statistics[$subReport->getType()] + 1
            : 1;
            $report->add($subReport);
            $count++;
            if ($limit !== 0 && $count === $limit) {
                break;
            }
        }
        
        if (empty($statistics)) {
            $report = new Report(Report::TYPE_INFO, __('No tasks to run'));
        } else {
            if (isset($statistics[Report::TYPE_ERROR]) || isset($statistics[Report::TYPE_WARNING])) {
                $report->setType(Report::TYPE_WARNING);
            }
            $report->setMessage(__('Ran %s task(s):', array_sum($statistics)));
        }
        return $report;
    }
1332882
def run(args):
    
    (opts, args) = PARSER.parse_args(args) if args else PARSER.parse_args()
    if not len(args):
        PARSER.print_usage()
        sys.exit(1)

    outfilename = args[0] + ".html"
    if len(args) > 1:
        outfilename = args[1]

    report = parser.Junit(args[0])
    html = report.html()

    with open(outfilename, "wb") as outfile:
        outfile.write(html.encode('utf-8'))
628604
public AnalysisResultFuture run() {
        try {
            // the injection manager is job scoped
            final InjectionManager injectionManager = _configuration.getInjectionManager(_job);

            final LifeCycleHelper rowProcessingLifeCycleHelper = new LifeCycleHelper(injectionManager,
                    new ReferenceDataActivationManager(), _includeNonDistributedTasks);

            final RowProcessingPublishers publishers = new RowProcessingPublishers(_job, _analysisListener,
                    _taskRunner, rowProcessingLifeCycleHelper, _sourceColumnFinder);

            final AnalysisJobMetrics analysisJobMetrics = publishers.getAnalysisJobMetrics();

            // A task listener that will register either succesfull executions
            // or unexpected errors (which will be delegated to the
            // errorListener)
            JobCompletionTaskListener jobCompletionTaskListener = new JobCompletionTaskListener(analysisJobMetrics,
                    _analysisListener, 1);

            _analysisListener.jobBegin(_job, analysisJobMetrics);

            validateSingleTableInput(_transformerJobs);
            validateSingleTableInput(_filterJobs);
            validateSingleTableInput(_analyzerJobs);

            // at this point we are done validating the job, it will run.
            scheduleRowProcessing(publishers, rowProcessingLifeCycleHelper, jobCompletionTaskListener,
                    analysisJobMetrics);

            return new AnalysisResultFutureImpl(_resultQueue, jobCompletionTaskListener, _errorAware);
        } catch (RuntimeException e) {
            _analysisListener.errorUknown(_job, e);
            throw e;
        }

    }
244655
@Override
    public final Collection<Metric> gatherMetrics(final ICommandLine cl) throws MetricGatheringException {
        List<Metric> metrics = new ArrayList<Metric>();
        String hostname = cl.getOptionValue("hostname");
        if (hostname == null) {
            throw new MetricGatheringException("No hostname specified.", Status.WARNING, null);
        }

        String port = cl.getOptionValue("port", DEFAULT_PORT);
        String path = cl.getOptionValue("url", DEFAULT_PATH);
        String method = cl.getOptionValue("method", DEFAULT_METHOD);

        int timeout = DEFAULT_TIMEOUT;
        if (cl.hasOption("post")) {
            method = "POST";
        }
        boolean ssl = false;
        if (cl.hasOption("ssl") || cl.getOptionValue("certificate") != null) {
            port = cl.getOptionValue("ssl", DEFAULT_SSL_PORT);
            ssl = true;
        }

        if (cl.hasOption("timeout")) {
            try {
                timeout = Integer.parseInt(cl.getOptionValue("timeout"));
            } catch (NumberFormatException e) {
                throw new MetricGatheringException("Invalid numeric value for timeout.", Status.CRITICAL, e);
            }
        }
        if (!path.startsWith("/")) {
            path = "/" + path;
        }
        if (hostname.endsWith("/")) {
            hostname = hostname.substring(0, hostname.length() - 1);
        }

        long then = System.currentTimeMillis();

        String response = getHttpResponse(cl, hostname, port, method, path, timeout, ssl, metrics);
        int elapsed = (int) Utils.milliToSec(System.currentTimeMillis() - then);
        if (response != null) {
            metrics.addAll(analyzeResponse(cl, response, elapsed));
        }
        return metrics;
    }