Skip to content

Added time_in_execution attribute to /_cluster/pending_tasks response#17779

Closed
gargmanik13 wants to merge 1 commit intoopensearch-project:mainfrom
gargmanik13:time_execution_metrics
Closed

Added time_in_execution attribute to /_cluster/pending_tasks response#17779
gargmanik13 wants to merge 1 commit intoopensearch-project:mainfrom
gargmanik13:time_execution_metrics

Conversation

@gargmanik13
Copy link
Copy Markdown
Contributor

Description

Added time_in_execution attribute to /_cluster/pending_tasks response

  • For task under execution we will get execution time in response
  • For all other tasks, this will be zero
 OpenSearch git:(time_execution_metrics) ✗ curl -X GET "localhost:9200/_cluster/pending_tasks?pretty" \
     -H 'Content-Type: application/json'
{
  "tasks" : [
    {
      "insert_order" : 5,
      "priority" : "URGENT",
      "source" : "create-index [my_new_index], cause [api]",
      "executing" : true,
      "time_in_queue_millis" : 19703,
      "time_in_queue" : "19.7s",
      "time_in_execution_millis" : 19701,
      "time_in_execution" : "19.7s"
    },
    {
      "insert_order" : 6,
      "priority" : "URGENT",
      "source" : "create-index [my_new_index_2], cause [api]",
      "executing" : false,
      "time_in_queue_millis" : 8999,
      "time_in_queue" : "8.9s",
      "time_in_execution_millis" : 0,
      "time_in_execution" : "0s"
    },
    {
      "insert_order" : 7,
      "priority" : "URGENT",
      "source" : "create-index [my_new_index_3], cause [api]",
      "executing" : false,
      "time_in_queue_millis" : 3123,
      "time_in_queue" : "3.1s",
      "time_in_execution_millis" : 0,
      "time_in_execution" : "0s"
    }
  ]
}

Related Issues

Resolves #11818

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@github-actions github-actions bot added Cluster Manager enhancement Enhancement or improvement to existing feature or request labels Apr 3, 2025
Signed-off-by: Manik Garg <gargmanik1317@gmail.com>
@gargmanik13 gargmanik13 force-pushed the time_execution_metrics branch from 45c1497 to 991fe5f Compare April 3, 2025 09:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2025

❌ Gradle check result for 991fe5f: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cluster Manager enhancement Enhancement or improvement to existing feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Feature Request] Latency metrics of task execution in cluster manager

1 participant