Call the CasCrawler.getMetrics() method to return the metrics of a crawl. Metrics can be returned for a running crawl or (if the crawl is not running) for the last complete crawl.

The syntax of the method is:

CasCrawler.getMetrics(CrawlId crawlId)

The crawlId parameter is a CrawlId object that contains the name of the crawl for which metrics are to be returned.

The method returns a List<Metric> object, which (if not empty) will have one or more Metric objects. A Metric is a key-value pair that holds the value of a particular metric. The keys are the metric's ID (a MetricId enum class). See the CAS Server API Reference (Javadoc) for the list of MetricId enumerations.

The CRAWL_STOP_CAUSE MetricId has one of the following values:

If a crawl fails, the CRAWL_FAILURE_REASON MetricId provides a message from the CAS Server explaining the failure.

Your application can print out all or some of the metric values.

To get the metrics of a crawl:

The CasCrawler.getMetrics() method throws a CrawlNotFoundException if the specified crawl (the crawlId parameter) does not exist or is otherwise not found.


Copyright © Legal Notices