从TeamCity API获取统计历史记录 [英] Getting statistical history from 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屋!