mercredi 21 août 2019

JIRA Python script : iterate to get the JQL result

Python 2.7 script to :

  • query the result of a JIRA search query in JQL
  • iterate so that we do not get all the data at once but only by small batches
  • print the result list

Pre-requesites :

  • python
  • https://pypi.org/project/atlassian-python-api/
  • https://atlassian-python-api.readthedocs.io/en/latest/index.html
  • some JIRA Server or JIRA Cloud + credentials
    • Note that the auth for JIRA Cloud might change a bit



from atlassian import Jira
import json

#auth for JIRA Server
jira = Jira(
    url='https://support.valiantys.com',
    username='username',
    password='password')
# Get the SERVER issues that are Running
JQL = 'project = DEMO AND resolution = Unresolved AND issuetype = "Story" AND status = "In Progress" ORDER BY cf[16032] DESC, cf[15857] DESC'

data_tmp = {}   # data we progressively get each interation
issues_all = [] # full list of issues
issues_tmp = {} # list of issues during this iteration

next_start = 0
size = 50

while size > 0 :
        print("-------- trying to get issues:%s..%s" % (next_start, next_start+size))
        data_tmp = jira.jql(JQL, start=next_start, limit=size)
        next_start += size
        issues_tmp = data_tmp['issues']
        size = len(data_tmp['issues'])
        issues_all.extend(issues_tmp)

print ("(final) #issues=%s" % len(issues_all))

# now we can do things with the data
for x in issues_all:
print("%s %s %s %s" % (x['key'], x['fields']['customfield_16032'], x['fields']['customfield_15862'], x['fields']['customfield_15857']))

samedi 17 août 2019

Stress-ng - workload for testing

 (src = https://www.loggly.com/blog/performance-monitoring-aws-cloudwatch-metrics/ )

Step 1. Installing and Running Stress-ng

Stress-ng is a load simulator available for the Ubuntu operating system. The utility has a wide variety of command line switches used for customizing the load. The installation is fairly simple as well:

# apt-get install stress-ng

More details about stress-ng can be found on the Ubuntu man page.

Once the tool is installed, it can be run as a command to simulate a CPU load with the following:

4 worker threads
80% load
Timeout after 25 minutes (1,500 seconds)

# stress-ng --timeout 1500 --cpu 4 --cpu-load 80

CloudWatch Dashboard EC2 CPUUtilizationAs the CPU becomes more and more loaded, the the CPUUtilization metric in CloudWatch also reflects it:

jeudi 15 août 2019

HAR analyser

https://toolbox.googleapps.com/apps/har_analyzer/