temporal icon indicating copy to clipboard operation
temporal copied to clipboard

tdbg: --describe task queue partition

Open Shivs11 opened this issue 1 year ago • 0 comments

What changed?

Added a new tdbg subcommand : --describe-task-queue-partition which shall output the following statistics, per partition, for better visibility:

  • TQ statistics
  • List of pollers for each build ID
  • More metrics defined via InternalTaskQueueStatus struct (see this PR itself)

Usage

./tdbg taskqueue describe-task-queue-partition --task-queue "hello-world" --partition-id 2

Options/Flags for the command

OPTIONS:
   --namespace-id value     NamespaceId (default: "default")
   --task-queue value       Task Queue name
   --task-queue-type value  Task Queue type: activity, workflow (default: "TASK_QUEUE_TYPE_WORKFLOW")
   --partition-id value     Partition ID (default: 0)
   --sticky-name value      Sticky Name for a task queue partition, if present
   --build-ids value        Build IDs  (accepts multiple inputs)
   --unversioned            Unversioned task queue partition (default: true)
   --all-active             All active task queue versions (default: true)
   --help, -h               show help (default: false)

Sample output

{
  "versionsInfoInternal":  {
    "":  {
      "physicalTaskQueueInfo":  {
        "taskQueueStats":  {
          "approximateBacklogCount":  "1",
          "approximateBacklogAge":  "77.055474s"
        }
      },
      "internalTaskQueueStatus":  {
        "readLevel":  "2",
        "ackLevel":  "1",
        "taskIdBlock":  {
          "startId":  "3",
          "endId":  "100000"
        }
      }
    }
  }
}

Why?

  • better visibility into TQ metrics per partition

How did you test it?

  • 100% unit test coverage
  • Added more tests for DescribeTaskQueuePartition specifically
  • Tested the command locally

Potential risks

None, this is an internal tool.

Is hotfix candidate?

nope

Shivs11 avatar Aug 26 '24 21:08 Shivs11