Skip to end of metadata
Go to start of metadata

TeamCity provides a number of ways to customize statistics. You can add your own custom metrics to integrate your tools/processes, insert any statistical chart/report into statistic page extension places and so on.

This page describes programmatic approaches to statistics customization. For user-level customizations, please refer to the Custom Chart page.

On this page:

Customize TeamCity Statistics Page

Add Chart

To add a chart to the Statistics tab for a project or build configuration, use the ChartProviderRegistry bean:

Add Custom Content

To add custom content to the Statistics tab for a project or build configuration, use the following example here and the appropriate PlaceId:

    • for Build Configuration Statistics tab, use PlaceId.BUILD_CONF_STATISTICS_FRAGMENT
    • for Project Statistics tab, use PlaceId.PROJECT_STATS_FRAGMENT.

Add Statistics to your Custom Pages

To add charts to your custom JSP pages, use the <buildGraph> tag and a special controller accessible on "/buildGraph.html". It requires the jsp attribute leading to your page:

To insert statistics chart into the sampleChartPage.jsp:

Customize Chart Appearance

Attribute

Description

Usage

width, height

modify the chart image size

Integer value

hideFilters

suppress filter controls

Comma separated filters names: 'all', 'series', 'average', 'showFailed', 'range', 'yAxisType', 'forceZero' or 'yAxisRange'

defaultFilter

default filter state

Comma separated names: 'showFailed', 'averaged', 'logYAxis', 'autoscale'

hints

chart style

Set to 'rendererB' for a bar chart

Add Custom Build Metrics

To add a custom build metric, in addition to the built-in methods, you can extend BuildValueTypeBase to define your build metric calculation method, appearance, and key. After that you can reference this metric by its key in statistics chart/report tags.



See also:

  • No labels