从 TeamCity API 获取统计历史 [英] Getting statistical history from TeamCity API

查看:19
本文介绍了从 TeamCity API 获取统计历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过查看 TeamCity REST API 文档,对统计数据的要求是:

From looking at the TeamCity REST API Documentation, the request for statistical data is:

http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/statistics/ 

哪个有效,然而,它只提供当前构建的统计信息(通过的测试、代码覆盖率、重复数量等),我正在为我的构建散热器构建一个图表,显示趋势,因此我想要过去一个月的历史数据.

Which works, however, it only gives statistics for the current build (tests passed, code coverage, number of duplicates, etc.), I am looking to build a graph for my build radiator showing trends, therefore I want the historical data for the past month.

有没有办法从 TeamCity API 中获取这些历史统计数据?

Is there a way to get this historical statistic data from the TeamCity API?

推荐答案

很遗憾,我无法仅从 TeamCity API 获取此数据,因此解决方案是与数据库相反.

Unfortunately, I was unable to get this data solely from the TeamCity API, so the solution was to go against the database instead.

select 
    build_data_storage.build_id, 
    build_type_mapping.ext_id as 'build_type_id',
    data_storage_dict.value_type_key as 'metric_name', 
    build_data_storage.metric_value,
    history.build_number,
    history.build_finish_time_server
from 
    build_data_storage
join 
    data_storage_dict on build_data_storage.metric_id = data_storage_dict.metric_id
join
    history on build_data_storage.build_id = history.build_id
join
    build_type_mapping on history.build_type_id = build_type_mapping.int_id

这篇关于从 TeamCity API 获取统计历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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