| You are viewing documentation of TeamCity 4.x, which is not the most recent released version of TeamCity. Please refer to the listing to choose another version. |
OverviewIn TeamCity, it is possible to configure a build script to report statistical build data (build metrics) and then display the data on charts. To display a custom chart you will need to configure your build script to report the data and configure TeamCity to show the corresponding charts. Configuring Charts PresentationTeamCity allows to display custom charts either on the Build Configuration Statistics page or on the Project Statistics Page, depending on the settings. The settings for custom charts are stored in the XML files. In the chart configuration, you can use either pre-defined metrics provided by TeamCity, or the values reported from the build script. Build-Configuration Level ChartsThe chart is shown on the Statistics tab of the Build Configuration. The chart is displayed for those Build Configurations that has appropriate data reported by the builds. The settings are configured in the <TeamCity data dir>/config/main-config.xml file by "graph" tags. You can edit the file while server is running, it will be automatically reloaded. <server ...> <!-- Some other stuff --> <graph title="Passed Test Count" seriesTitle="Configuration"> <valueType key="PassedTestCount" title="This configuration" /> <valueType key="PassedTestCount" title="Passed Test Count" buildTypeId="bt32"/> <!-- This is explicit reference to build configuration --> </graph> <graph title="Tests against Coverage"> <valueType key="PassedTestCount" title="Tests" /> <valueType key="CodeCoverageL" title="Line coverage" /> </graph> <graph title="Custom data" seriesTitle="Metric name"> <valueType key="key1" title="Metric 1" /> <valueType key="key2" title="Metric 1" /> <valueType key="BuildDuration" title="Duration" /> </graph> </server> Project-Level ChartsThe chart is shown on the Statistics tab for the individual Project. The settings are configured in the <TeamCity data dir>/config/<Project Name>/plugin-settings.xml file by "graph" tags. You can edit the file while server is running, it will be automatically reloaded. Almost the same as for main-config.xml, but there is an intermediate custom-graphs tag: <settings> <custom-graphs> <graph title="Duration comparison" hideFilters="showFailed" seriesTitle="some keys"> <valueType key="BuildDuration" title="duration2" buildTypeId="bt7"/> <valueType key="BuildDuration" title="duration1" buildTypeId="bt3"/> <valueType key="customKey" title="Custom data" /> <!-- Will use data from build configuration bt3 --> </graph> </custom-graphs> </settings> Tags description<graph>This tag describes a single chart. It may contain one or more valueType subtags, which describe series of data shown on the chart.
<valueType>This tag describes a series of data shown on the chart. Each series is drawn with a separate color and you may choose one or another series using a filter. The attributes of the tag are:
Data Sources (valueType keys)Pre-defined Value Providers
Reporting Custom Charts Data
There are two ways to publish values for custom metrics — using teamcity-info.xml file or using service messages from your build.
See Also:
|