2

Closed

Cannot remove default statistics (include="false")

description

If the <statisticList> is populated with any <statistic> entries which remove the default statistics they are not handled properly.
 
Steps:
 
Add a section like this to ccnet.config:
 
        <statistics>
            <statisticList>
                <statistic name="FxCop Warnings" xpath="" include="false"/>
                <statistic name="FxCop Errors" xpath="" include="false"/>
            </statisticList>
        </statistics>            
 
and then attempt to regenerate statistics. If you add a valid xpath, then the application no longer crashes with an exception but it also does not remove the default entry, it adds a duplicate instead.
Closed Jan 20, 2009 at 12:07 AM by Matt_Ryan
Fixed. StartTime must not be excluded for updating of existing nodes to work, and should add a warning for that, but will create another issue.

comments

medington wrote Oct 12, 2007 at 12:48 AM

Since there is no workaround I went ahead and fixed this.

In CCStatisticsPublisher.cs::Run use this code:
            Statistic statistic = _configuredStatistics[i];
            if (statistic.Include)
            {
                builder.Statistics.Add(statistic);
            }
            else
            {
                builder.Statistics.Remove(statistic);
            }

medington wrote Oct 12, 2007 at 5:19 PM

Note the above code change only fixes the output. The UI still lists all of the default statistics even if they are excluded.

DamonCarr wrote Oct 19, 2007 at 9:50 PM

Nice! Would you like rights to be granted check out privledges?

Thanks again,
Damon

wrote Oct 19, 2007 at 9:50 PM

wrote May 28, 2008 at 9:21 PM

wrote Jun 20, 2008 at 1:22 PM

wrote Jan 20, 2009 at 12:07 AM

wrote Feb 13, 2013 at 5:18 PM

wrote May 15, 2013 at 1:41 AM