You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Tom Beerbower (JIRA)" <ji...@apache.org> on 2013/10/24 17:54:01 UTC

[jira] [Commented] (AMBARI-3583) Requests API should rollup tasks information

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

Tom Beerbower commented on AMBARI-3583:
---------------------------------------

Adding the following properties to request resources ...

 # *Requests/request_status* - the request status 
 # *Requests/task_count* - the total number of tasks for this request
 # *Requests/failed_task_count* - the number of failed tasks
 # *Requests/aborted_task_count* - the number of aborted tasks
 # *Requests/timed_out_task_count* - the number of timed out tasks
 # *Requests/completed_task_count* - the number of tasks that have finished running either because they completed or failed
 # *Requests/queued_task_count* - the number of tasks that are queued to run
 # *Requests/progress_percent* - the percent of progress towards request completion

Request status is calculated as follows ...
{code}
if :
  failed_task_count > 0 then request_status = FAILED
else if :
  aborted_task_count > 0 then request_status = ABORTED
else if :
  timed_out_task_count > 0 then request_status = TIMEDOUT
else if :
  completed_task_count < task_count then request_status  = IN_PROGRESS
else :
  request_status = COMPLETED
{code}

The progress percent is calculated as follows ...

{code}
progressPercent =
        (queued_task_count * 0.09 +
         (task_count - completed_task_count - queued_task_count) * 0.35 +  // in progress
         completed_task_count / task_count) * 100;
{code}


You can see the request properties with the following request ...

{code}
/api/v1/clusters/c1/requests?fields=Requests
{code}

{code}
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/requests?fields=Requests",
  "items" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/requests/1",
      "Requests" : {
        "aborted_task_count" : 0,
        "cluster_name" : "c1",
        "completed_task_count" : 14,
        "failed_task_count" : 0,
        "id" : 1,
        "progress_percent" : 100.0,
        "queued_task_count" : 0,
        "request_context" : "Install Services",
        "request_status" : "COMPLETED",
        "task_count" : 14,
        "timed_out_task_count" : 0
      }
    },
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/c1/requests/2",
      "Requests" : {
        "aborted_task_count" : 0,
        "cluster_name" : "c1",
        "completed_task_count" : 14,
        "failed_task_count" : 0,
        "id" : 2,
        "progress_percent" : 100.0,
        "queued_task_count" : 0,
        "request_context" : "Start Services",
        "request_status" : "COMPLETED",
        "task_count" : 14,
        "timed_out_task_count" : 0
      }
    }
  ]
}
{code}

> Requests API should rollup tasks information
> --------------------------------------------
>
>                 Key: AMBARI-3583
>                 URL: https://issues.apache.org/jira/browse/AMBARI-3583
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Tom Beerbower
>            Assignee: Tom Beerbower
>         Attachments: AMBARI-3583.patch
>
>
> Ambari UI shows the number of background-operations. Clicking on it launches a dialog showing the progress/status of each request. We keep polling every 6s at the following URL:
> {code}
> http://server:8080/api/v1/clusters/ga/requests?to=end&page_size=10&fields=*,tasks/Tasks/*
> {code}
> On large clusters this is really really huge if you restarted services multiple times. All of this just to show the number of operations in progress, and the status of each request.
> We need a rollup of tasks data into the request itself, so that we dont load the tasks (the heavy part) till details of a request are needed. So for each request we need 
> * Progress of the request: This takes into account the progress of various tasks. 100% means request is completed. 
> * State of the request: Depending on success/warn/failure of tasks, this will help UI show a red/green/yellow for the entire request.
> Our initial call will be to
> {code}
> http://server:8080/api/v1/clusters/ga/requests?to=end&page_size=10
> {code}
> Once a user drills into a request, we will be requesting entire details for it.
> {code}
> http://server:8080/api/v1/clusters/ga/requests/1?fields=tasks/Tasks/*
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)