[ 
https://issues.apache.org/jira/browse/OODT-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994821#comment-12994821
 ] 

Chris A. Mattmann edited comment on OODT-139 at 2/15/11 3:25 PM:
-----------------------------------------------------------------

I just wanted to provide some documentation on how to call the Health Monitor 
service. 

h2. JSON output format

All calls to the Health Monitor REST service provide the following JSON output:

{noformat}
{
    "report": {
        "crawlerStatus": {
            "Crawler1": {
                "crawlerName": "Crawler1", 
                "crawlerPort": "9020", 
                "status": "UP", 
                "url": "localhost"
            }
        }, 
        "daemonStatus": {
            "stubs": [
                {
                    "daemon": "batch stub", 
                    "status": "UP", 
                    "url": "http://localhost:2001";
                }
            ], 
            "fm": {
                "daemon": "File Manager", 
                "status": "UP", 
                "url": "http://localhost:9000";
            }, 
            "rm": {
                "daemon": "Resource Manager", 
                "status": "UP", 
                "url": "http://localhost:9002";
            }, 
            "wm": {
                "daemon": "Workflow Manager", 
                "status": "UP", 
                "url": "http://localhost:9001";
            }
        }, 
        "generated": "2011-02-15T06:57:07.591-0800", 
        "ingestHealth": [
            {
                "avgCrawlTime": 132.78640211640212, 
                "crawler": "Crawler1", 
                "numCrawls": 189
            }
        ], 
        "jobHealth": [
            {
                "numJobs": 0, 
                "state": "QUEUED"
            }, 
            {
                "numJobs": 0, 
                "state": "RSUBMIT"
            }, 
            {
                "numJobs": 0, 
                "state": "BUILDING CONFIG FILE"
            }, 
            {
                "numJobs": 0, 
                "state": "PGE EXEC"
            }, 
            {
                "numJobs": 0, 
                "state": "CRAWLING"
            }, 
            {
                "numJobs": 0, 
                "state": "STAGING INPUT"
            }, 
            {
                "numJobs": 7, 
                "state": "FINISHED"
            }, 
            {
                "numJobs": 0, 
                "state": "STARTED"
            }, 
            {
                "numJobs": 0, 
                "state": "PAUSED"
            }
        ], 
        "latestFiles": {
            "files": [
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:19:21.126-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:08:10.198-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:06:03.659-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/blah.txt/blah.txt", 
                    "receivedTime": "2011-01-21T21:56:03.922-08:00"
                }
            ], 
            "topN": 20
        }
    }
}


{noformat}

The below REST-ful service descriptions show how to slice out different parts 
of the report. All reports at least have the *generatedTime* attribute, and 
then some combination of *daemonStatus*, and/or *crawlerStatus*, and (if the 
file manager is running) *latestFiles*, and if the workflow manager is running 
*jobHealth*, and if the crawlers are running *ingestHealth*.

h2. Full Report

To see the full Health Monitor report, access:

{noformat}
http://host/pcs-services/services/health/report
{noformat}

h2. Just the Daemons

To see the Health Monitor report, focused on just the PCS daemons (including 
batch stubs), access:

{noformat}
http://host/pcs-services/services/health/report/daemon
{noformat}

Note that daemons can be further "sliced out" by adding additional REST 
parameters, e.g.:

h3. To see just the file manager status:

{noformat}
http://host/pcs-services/services/health/report/daemon/fm
{noformat}

h3. To see just the workflow manager status

{noformat}
http://host/pcs-services/services/health/report/daemon/wm
{noformat}

h3. To see just the resource manager status

{noformat}
http://host/pcs-services/services/health/report/daemon/rm
{noformat}

h3. To see just the batch stub status

{noformat}
http://host/pcs-services/services/health/report/daemon/stubs
{noformat}

h2. Just the Crawlers

To see the Health Monitor report, focused on just the PCS ingest crawlers, 
access:

{noformat}
http://host/pcs-services/services/health/report/crawlers
{noformat}

Crawlers can also be sliced out, similar to daemons, e.g.:

h3. Slice a crawler out by name

To see a crawler with the name Crawler1, slice it out by:

{noformat}
http://host/pcs-services/services/health/report/crawlers/Crawler1
{noformat}

h2. Just Job Processing Status

To see the Health Monitor report, focused on just the PCS workflow (job) 
processing status, broken down by state, access:

{noformat}
http://host/pcs-services/services/health/report/jobs
{noformat}

Job status may also be sliced out, similar to daemons and crawlers, by using 
the state parameter, e.g.:

h3. Slice a job processing status by state

The following will display the number of jobs that are in the QUEUED state:

{noformat}
http://host/pcs-services/services/health/report/jobs/QUEUED
{noformat}

h2. Just Ingest Processing Health

To see the Health Monitor report, focused on just the PCS ingest crawler health 
(with information like number of crawls and average crawl time), broken down by 
Crawler, access:

{noformat}
http://host/pcs-services/services/health/report/ingest
{noformat}

Ingest crawler health status can be sliced, similar to daemon status, crawler 
status, and the other types of information, e.g.:

h3. Slice ingest crawler health status by name

To see the ingest health status of the Crawler with the name Crawler1, access:

{noformat}
http://host/pcs-services/services/health/report/ingest/Crawler1
{noformat}


      was (Author: chrismattmann):
    I just wanted to provide some documentation on how to call the Health 
Monitor service. 

h2. JSON output format

All calls to the Health Monitor REST service provide the following JSON output:

{noformat}
{
    "report": {
        "crawlerStatus": {
            "Crawler1": {
                "crawlerName": "Crawler1", 
                "crawlerPort": "9020", 
                "status": "UP", 
                "url": "localhost"
            }
        }, 
        "daemonStatus": {
            "stubs": [
                {
                    "daemon": "batch stub", 
                    "status": "UP", 
                    "url": "http://localhost:2001";
                }
            ], 
            "fm": {
                "daemon": "File Manager", 
                "status": "UP", 
                "url": "http://localhost:9000";
            }, 
            "rm": {
                "daemon": "Resource Manager", 
                "status": "UP", 
                "url": "http://localhost:9002";
            }, 
            "wm": {
                "daemon": "Workflow Manager", 
                "status": "UP", 
                "url": "http://localhost:9001";
            }
        }, 
        "generated": "2011-02-15T06:57:07.591-0800", 
        "ingestHealth": [
            {
                "avgCrawlTime": 132.78640211640212, 
                "crawler": "Crawler1", 
                "numCrawls": 189
            }
        ], 
        "jobHealth": [
            {
                "numJobs": 0, 
                "state": "QUEUED"
            }, 
            {
                "numJobs": 0, 
                "state": "RSUBMIT"
            }, 
            {
                "numJobs": 0, 
                "state": "BUILDING CONFIG FILE"
            }, 
            {
                "numJobs": 0, 
                "state": "PGE EXEC"
            }, 
            {
                "numJobs": 0, 
                "state": "CRAWLING"
            }, 
            {
                "numJobs": 0, 
                "state": "STAGING INPUT"
            }, 
            {
                "numJobs": 7, 
                "state": "FINISHED"
            }, 
            {
                "numJobs": 0, 
                "state": "STARTED"
            }, 
            {
                "numJobs": 0, 
                "state": "PAUSED"
            }
        ], 
        "latestFiles": {
            "files": [
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:19:21.126-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:08:10.198-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/foo.bar/foo.bar", 
                    "receivedTime": "2011-01-22T15:06:03.659-08:00"
                }, 
                {
                    "filepath": "/Users/mattmann/files/blah.txt/blah.txt", 
                    "receivedTime": "2011-01-21T21:56:03.922-08:00"
                }
            ], 
            "topN": 20
        }
    }
}


{noformat}

The below REST-ful service descriptions show how to slice out different parts 
of the report. All reports at least have the *generatedTime* attribute, and 
then some combination of *daemonStatus*, and/or *crawlerStatus*, and (if the 
file manager is running) *latestFiles*, and if the workflow manager is running 
*jobHealth*, and if the crawlers are running *ingestHealth*.

h2. Full Report

To see the full Health Monitor report, access:

{noformat}
http://host/pcs-services/services/health/report
{noformat}

h2. Just the Daemons

To see the Health Monitor report, focused on just the PCS daemons (including 
batch stubs), access:

{noformat}
http://host/pcs-services/services/health/report/daemon
{noformat}

Note that daemons can be further "sliced out" by adding additional REST 
parameters, e.g.:

h3. To see just the file manager status:

{noformat}
http://host/pcs-services/services/health/report/daemon/fm
{noformat}

h3. To see just the workflow manager status

{noformat}
http://host/pcs-services/services/health/report/daemon/wm
{noformat}

h3. To see just the resource manager status

{noformat}
http://host/pcs-services/services/health/report/daemon/rm
{noformat}

h3. To see just the batch stub status

{noformat}
http://host/pcs-services/services/health/report/daemon/stubs
{noformat}





  
> PCS JAX-RS services
> -------------------
>
>                 Key: OODT-139
>                 URL: https://issues.apache.org/jira/browse/OODT-139
>             Project: OODT
>          Issue Type: New Feature
>          Components: pcs
>            Reporter: Chris A. Mattmann
>            Assignee: Chris A. Mattmann
>              Labels: jaxrs, jsr311, pcs
>             Fix For: 0.3
>
>         Attachments: OODT-139.Mattmann.021311.patch.txt, 
> OODT-139.Mattmann.021411.2.patch.txt, OODT-139.Mattmann.021411.patch.txt
>
>
> Now that the PCS core is contributed, it would be great to not just have 
> command line versions and APIs for tools like pcs_stat, pcstrace and pcs_ll. 
> We should expose them over JAX-RS so that webapps can easily take advantage 
> of PCS services.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to