Boost logo

Boost :

From: christopher diggins (cdiggins_at_[hidden])
Date: 2005-02-11 09:50:44


----- Original Message -----
From: "Brian Braatz" <brianb_at_[hidden]>
> I might want to accumulate ALL of the calls, in one big honking list.

You can already do that in a few different ways:

1) simply naming all of the profiles the same,

2) writing a new stats policy,

3) write:

{
  stats_map::iterator i = default_stats_policy::stats::begin();
  counted_sum cs;
  while (i != default_stats_policy::stats::end) {
    cs += *i++;
  }
  cout << "total profiler entries : " << cs.first << endl;
  cout << "total elapsed time : " << cs.second << endl;
  cout << "average time per profile : " << cs.second / cs.first << endl;
}

4) I could simply add some features to the default_stats_policy, if that is
more appropriate.

I don't know what the best option is.

> Or
> I might want a "overview" of the average of each profile point.

Currently also already provided in the default_stats_policy, if I understand
you correctly.

> I think we need both, in addition to allowing me to put metadata into
> the profile point. Because with the metadata, I can now go back through
> the accumulated list and filter out what I care about.

I am seriously considering the metadata idea.

I agree with your earlier ideas that the identifier for a profile should not
be restricted to a char*.
A problem with the current design is that a by passing a type for the
profile idenitifer affects not just the profile, but also the stats policy
and the log policy. In this case of having three dependant policies, I would
far prefer to have a single profile_management policy. This is not a huge
problem however.

Thanks for your suggestions,
Christopher


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk