AutoSys Workload Automation

 View Only
  • 1.  How to get the average runtime last 5 successful job runs

    Posted Sep 26, 2024 02:45 PM

    Hello all, 

    For an automation usecase, I would like to get the average runtime for last 5 successful job executions for a particular job.

    Can anyone let me know what is the autosys command for this? If autorep command can list the details of last 5 successful runs, I can use bash to process the output.

    Can anyone let me know the autorep options to get this details of last 5 successful runs?

    Thanks 



  • 2.  RE: How to get the average runtime last 5 successful job runs

    Broadcom Employee
    Posted Sep 27, 2024 09:05 AM

    You can use the -r argument with autorep to get previous runs. For example, to get one run back:

    autorep -j testjob -r-1

    Two runs back:

    autorep -j testjob -r-2

    etc...

    With some bash logic you can loop thru previous runs, check the output for Success, and calculate the average.



    ------------------------------
    Mike Kruse
    Automation Capability Specialist
    Agile Operations Division, Broadcom Software
    micheal.kruse@broadcom.com
    ------------------------------



  • 3.  RE: How to get the average runtime last 5 successful job runs

    Broadcom Employee
    Posted Sep 27, 2024 09:17 AM

    Something like: for i in {0..4}; do autorep -j jobName -R -$i; done

    Mike




  • 4.  RE: How to get the average runtime last 5 successful job runs

    Broadcom Employee
    Posted Sep 27, 2024 09:31 AM

    Another alternative is to use the REST API

    curl -X GET "https://hostName:9443/AEWS/job-run-info/jobName?runcount=5" -H "accept: application/json"

    That will return the 5 runs in one call, but you would need to parse the json to get the start/end times.

    Mike