How to measure the packet payload size when work items are retrieved via the Jira Align REST API
Summary
It can be useful to find the average size of the transferred work item payloads in order to predict the approximate load that might be put on an API GW located between between Jira and Jira Align.
This article proposes a method for how to measure the package payload size of work items pulled through the Jira Align REST API.
Environment
Jira Align
Solution
By sampling method, the average payload size can be determined with an approximate value.
Find a valid API 2.0 Token ( ref: Getting started with the REST API 2.0 )
Adapt the curl command, below:
2.1. Replace <your-instance.jiraalign.com>
2.2. Replace <replace-this-with-user-API-token>
2.3. Replace <work-item-endpoint>Run the customized command from the command-prompt
curl -s -L -I --location --request GET 'https://<your-instance.jiraalign.com>/rest/align/api/2/<work-item-endpoint>' \
--header 'Authorization: Bearer <replace-this-with-user-API-token>' \
| grep "content-length" |awk '{printf "%.2f Kb\n", $2 / 1024 }'
Notes
The "content-length" field shows the payload size in Bytes
The above command returns the first 100 work item’s size. (If there are less than 100, all are returned.) To find the average size, this size should be divided by the number of items returned as a result of the query.
In windows, there is no grep command. You can use "findstr" as a replacement OR please search for the ways to run Linux Commands in Windows.