This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new ec5efdece fix: update CircleCI dashboard, and add missing
`queued_duration_sec` field when cicd_piplines are transformed to
cicd_deployment_commits (#6716)
ec5efdece is described below
commit ec5efdece1e34e1f67ec7be7339f64b38dc5ccd3
Author: Lynwee <[email protected]>
AuthorDate: Tue Jan 2 17:23:42 2024 +0800
fix: update CircleCI dashboard, and add missing `queued_duration_sec` field
when cicd_piplines are transformed to cicd_deployment_commits (#6716)
* fix(grafana): fix circle ci dashboard
* fix(dora): add missing `queued_duration_sec` field
---
backend/plugins/dora/tasks/deployment_commits_generator.go | 13 ++++++++-----
grafana/dashboards/Circleci.json | 6 +++---
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/backend/plugins/dora/tasks/deployment_commits_generator.go
b/backend/plugins/dora/tasks/deployment_commits_generator.go
index d616396ec..9fc53c479 100644
--- a/backend/plugins/dora/tasks/deployment_commits_generator.go
+++ b/backend/plugins/dora/tasks/deployment_commits_generator.go
@@ -46,6 +46,7 @@ type pipelineCommitEx struct {
OriginalStatus string
OriginalResult string
DurationSec *float64
+ QueuedDurationSec *float64
CreatedDate *time.Time
FinishedDate *time.Time
Environment string
@@ -69,6 +70,7 @@ func GenerateDeploymentCommits(taskCtx plugin.SubTaskContext)
errors.Error {
p.result,
p.status,
p.duration_sec,
+ p.queued_duration_sec,
p.created_date,
p.finished_date,
p.environment,
@@ -138,11 +140,12 @@ func GenerateDeploymentCommits(taskCtx
plugin.SubTaskContext) errors.Error {
CreatedDate:
*pipelineCommit.CreatedDate,
FinishedDate:
pipelineCommit.FinishedDate,
},
- DurationSec: pipelineCommit.DurationSec,
- CommitSha: pipelineCommit.CommitSha,
- RefName: pipelineCommit.Branch,
- RepoId: pipelineCommit.RepoId,
- RepoUrl: pipelineCommit.RepoUrl,
+ DurationSec: pipelineCommit.DurationSec,
+ QueuedDurationSec:
pipelineCommit.QueuedDurationSec,
+ CommitSha: pipelineCommit.CommitSha,
+ RefName: pipelineCommit.Branch,
+ RepoId: pipelineCommit.RepoId,
+ RepoUrl: pipelineCommit.RepoUrl,
}
if pipelineCommit.FinishedDate != nil &&
pipelineCommit.DurationSec != nil {
s :=
pipelineCommit.FinishedDate.Add(-time.Duration(*pipelineCommit.DurationSec) *
time.Second)
diff --git a/grafana/dashboards/Circleci.json b/grafana/dashboards/Circleci.json
index dec17471e..a61c2cf79 100644
--- a/grafana/dashboards/Circleci.json
+++ b/grafana/dashboards/Circleci.json
@@ -29,7 +29,7 @@
},
"id": 58,
"options": {
- "content": "- Use Cases: This dashboard shows the basic CI/CD metrics
from Circleci, such as [Build
Count](https://devlake.apache.org/docs/Metrics/BuildCount), [Build
Duration](https://devlake.apache.org/docs/Metrics/BuildDuration) and [Build
Success Rate](https://devlake.apache.org/docs/Metrics/BuildSuccessRate).\n-
Data Source Required: Circleci",
+ "content": "- Use Cases: This dashboard shows the basic CI/CD metrics
from CircleCI, such as [Build
Count](https://devlake.apache.org/docs/Metrics/BuildCount), [Build
Duration](https://devlake.apache.org/docs/Metrics/BuildDuration) and [Build
Success Rate](https://devlake.apache.org/docs/Metrics/BuildSuccessRate).\n-
Data Source Required: CircleCI",
"mode": "markdown"
},
"pluginVersion": "8.0.6",
@@ -971,7 +971,7 @@
},
"timepicker": {},
"timezone": "",
- "title": "Circleci",
- "uid": "W8AiDFQnk",
+ "title": "CircleCI",
+ "uid": "W8AiDFQmk",
"version": 10
}
\ No newline at end of file