help needed to add built specific statistics

I've added some console output within my build such as

##teamcity[buildStatisticValue key='ProjectName:CoveredTableCount' value='60']
##teamcity[buildStatisticValue key='ProjectName:UncoveredTableCount' value='94']



I can see these in the actual build log

and I've followed this documentation page:
http://confluence.jetbrains.net/display/TCD5/Custom+Chart

leading me to add a <graph/> element to main-config.xml:


  <graph title="Arbirtrary graph title" defaultFilters="" hideFilters="showFailed" seriesTitle="Arbitrary series title">
    <valueType key="ProjectName:CoveredTableCount" title="Covered table count" buildTypeId="6" />
    <valueType key="ProjectName:UncoveredTableCount" title="Uncovered table count" buildTypeId="6" />
  </graph>


after several trials, I didn't succeed, the particular build never showed a "statistics" tab.

I also tried to move these statistics at project level but only succeeded to display an empty graph (values do not seem to be picked up).

Any idea what I'm missing to get the build statistics to show up?

Thanks for your help!
4 comments

Hello,

   I suspect that you should replace buildTypeId="6" with buildTypeId="bt6" . Could you please try it?

   Best regards,
   KIR

0

Hello Kirill,

I tried to change the ids with the one matching the url, same as you gave: bt6 and the statistic is not showing in the build configuration statistic screen.

Any other idea about what might be wrong?

Thanks for your help.

0

Hello,

   Could you please clarify how do you log the messages? Can you provide your build log?

    I've just created a configuration with copy-paste from your data (just fixed buildTypeIds) and it works for me.

   The graph from 2 builds looks like the following:

stats test __ tes > Statistics -- TeamCity.png

0

These messages are logged through Console.WriteLine (.NET) in a NUnit test dll, run via an msbuild configuration setting
here is an excerpt of the full build log output:

...
...
##teamcity[buildStatisticValue key='ProjectName:CoveredTableCount' value='60']
##teamcity[buildStatisticValue key='ProjectName:UncoveredTableCount' value='94']
[10:45:56]: Tests run: 8, Errors: 0, Failures: 0, Inconclusive: 0 Time: 151.2121512 seconds
  Not run: 4, Invalid: 0, Ignored: 4, Skipped: 0
...
...

What you shown is exactly what I'm looking for, I hope I'm not so far :)

0

Please sign in to leave a comment.