捕获詹金斯中每个流水线阶段所花费的时间 [英] Capture time taken by each pipeline stage in jenkins

查看:50
本文介绍了捕获詹金斯中每个流水线阶段所花费的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jenkins中使用了多分支管道,并且想记录每个管道阶段花费的时间并将其存储在DB中.关于如何获取每个构建阶段的持续时间的任何想法?我只是想了解每个阶段的持续时间

I am using a multibranch pipeline in jenkins and would like to record time taken by each pipeline stage and store it in DB. Any ideas on how to get the individual time durations for each build stage? I am just trying to get duration of each stage

推荐答案

一个人也可以使用Jenkins工作流API来获取每个阶段的数据-

One can use Jenkins workflow API as well to get the data of each stage -

https://Jenkins_URL/job/${jobName}/wfapi/runs

这将返回一个JSON对象数组(默认情况下最后10个运行)

This will return an array of JSON objects (last 10 runs by default)

然后可以将这些数据存储在InfluxDB之类的时间序列数据库中.

This data can then be stored in a time-series DB like InfluxDB.

这篇关于捕获詹金斯中每个流水线阶段所花费的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆