I want to track the times it takes to deploy a project to see a trend or alert on outliers

Aaron Johnson May 25, 2022

I want to track the times it takes to deploy a project. (self-hosted Bamboo)

Through the web I can look at the logs and see who started(or stopped) a deploy, when it started, how long it ran, and if it succeeded or failed. All great stuff!

I want to find this data either in a report built in, or point me to where I can get physical access to these logs so that I can parse them and get the data/trending myself.

What I want to do is see how the changes we make affect the deployment runtime. Did the change I just made significantly change the deploy time? Are the times getting progressively longer? Etc. Bonus would be to also see if it succeeded or Failes and if it was manually stopped.

 

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2022

Hello @Aaron Johnson,

Welcome to Atlassian Community!

You can try the following SQL. It works on PostgreSQL.

SELECT DR.VERSION_ID       Version_id,
DP.DESCRIPTION Proj_description,
DP.NAME Proj_name,
DE.NAME Env_Name,
DE.DESCRIPTION Descr,
DR.VERSION_NAME Release_Name,
DP.PLAN_KEY Source_Build_Plan,
DR.STARTED_DATE Started_date,
DR.QUEUED_DATE Queued_date,
DR.EXECUTED_DATE Exec_date,
DR.FINISHED_DATE Finished_date,
DR.DEPLOYMENT_STATE Result_State
FROM DEPLOYMENT_ENVIRONMENT DE
JOIN DEPLOYMENT_RESULT DR
ON DR.ENVIRONMENT_ID = DE.ENVIRONMENT_ID
JOIN DEPLOYMENT_VERSION DV
ON DV.DEPLOYMENT_VERSION_ID = DR.VERSION_ID
JOIN DEPLOYMENT_PROJECT DP
ON DP.DEPLOYMENT_PROJECT_ID = DV.PROJECT_ID
WHERE DR.EXECUTED_DATE = (SELECT Max(EXECUTED_DATE)
FROM DEPLOYMENT_RESULT
WHERE VERSION_ID = DR.VERSION_ID
AND ENVIRONMENT_ID = DE.ENVIRONMENT_ID)
AND ( ( DR.EXECUTED_DATE <= '2023-01-01 00:00:00' )
OR DR.EXECUTED_DATE IS NULL )
ORDER BY DR.EXECUTED_DATE DESC,
DR.DEPLOYMENT_STATE DESC

It has a date filter (current set to 2023 it will capture anything) but you can set it to a specific period to ease the filtering.

Then, you will need to understand the values from the *_date tables and do your reporting.

 

Regards,

Eduardo Alvarenga
Atlassian Support APAC

Aaron Johnson May 26, 2022

Wonderful! This looks like it will answer my need. I will give it a whirl and see how it goes.

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 26, 2022

Thank you @Aaron Johnson. Don't forget to mark the answer as accepted.

Aaron Johnson June 1, 2022

Sorry for the delay in "accepting" It took me a while to gain access to the Pastgresql db to confirm.

Thank you very much!

Like Eduardo Alvarenga likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events