That brings back memories...
The Windows data grid that the DistributionMonitor code uses doesn't support 64 bit numbers which is what the is needed for high throughput situations. I made this consolation when I made the app but I guess I should have commented more thoroughly on the implications of only using the lower 32 bits of the statistics values.
This code is only making use of the low 32bits of the 64bit Common::ULong64 structure returned. The reason you are getting negative numbers is that the low 32bits is getting flipped as the high 32bits is incremented (when you go over the 32 bit boundary the lower 32 bit number starts back at zero).
The correct way to extract the values would be to use that method I pointed you to to get the correct value
UInt64 build64(iControl.CommonULong64 ul64)
{
return ((UInt64)(UInt32)ul64.high) << 32 | ((UInt64)(UInt32)ul64.low);
}
public UInt64 findStatisticType(PoolMember.CommonStatistic[] stat_list,
PoolMember.CommonStatisticType stat_type)
{
//The DataGrid does not support 64 bit integers
// so this is cast to the lower 32 bits
UInt64 value = 0;
for(int i=0; i {
if ( stat_type == stat_list[ i ].type )
{
value = build64(stat_list[ i ].value);
}
}
return value;
}
Don't go applying this to the distribution monitor example as the windows datagrid won't support the 64 bit numbers.
-Joe