summaryrefslogtreecommitdiffstats
path: root/base/histogram.cc
Commit message (Collapse)AuthorAgeFilesLines
* base/ header cleanup. Forward declaration instead of including.erg@google.com2010-07-281-0/+45
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3068004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53969 0039d316-1c4b-4281-b951-d872f2087c98
* Compress and checksum pending logs that are going to be persisted. Persisted ↵ziadh@chromium.org2010-07-191-3/+3
| | | | | | | | | | | | | | | | logs now have the following format: [list_size, log1, log2, ..., log_n, checksum]. where each log is bzipped before being written. Upon reading the logs from disk, we verify the data and register whether we faced corruptions or not. r=jar Review URL: http://codereview.chromium.org/2936005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52885 0039d316-1c4b-4281-b951-d872f2087c98
* Remove lock.h from resource_bundle.h and histogram.h.erg@chromium.org2010-07-161-0/+1
| | | | | | | | | | | Use a scoped_ptr<Lock> instead of Lock in resource bundle. BUG=none TEST=none Review URL: http://codereview.chromium.org/3038005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52730 0039d316-1c4b-4281-b951-d872f2087c98
* Do some minor cleanup in histogram.*jar@chromium.org2010-06-251-37/+10
| | | | | | | | | | | | | | | | | I was trying to debug some code, and noticed some excess complexity. There are no significant semantic changes. DCHECK on a foo.get() is a waste given we're about to deref the pointer. Execution cost should be be minially less, and we get rid of several lines of code. BUG=46263 r=mbelshe Review URL: http://codereview.chromium.org/2805033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50847 0039d316-1c4b-4281-b951-d872f2087c98
* Refactored Histogram::FactoryGet() to be style-compliantziadh@chromium.org2010-06-021-2/+2
| | | | | | | | | | Currently, two (2) overloaded versions of Histogram::FactoryGet() exist. Google's C++ style guide discourages such implementations. I refactored the methods into Histogram::FactoryGet() (no name change), which takes 'Sample' types as arguments, and Histogram::FactoryTimeGet(), which takes base::TimeDelta types as arguments. r = jar Review URL: http://codereview.chromium.org/2423004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48766 0039d316-1c4b-4281-b951-d872f2087c98
* Extend Histogram class to support custom range definitionsjar@chromium.org2010-04-291-5/+69
| | | | | | | | | | | | | | | | | | Some users have a small sparsely separated enumerated list of plausible samples which don't fit well into a default (log space) histogarm, or a consistently spaced (LinearHistogram). This implementation does not yet support renderer histograms of this sort, but it at least unblocks the dependent bug that needs support for these sparse histograms in the browser. The bulk of this patch was written by Raman Tenetti, in CL 1706012. BUG=40953 r=eroman Review URL: http://codereview.chromium.org/1737017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45998 0039d316-1c4b-4281-b951-d872f2087c98
* Upload renderer histograms to browser after a page loadsjar@chromium.org2010-01-021-16/+2
| | | | | | | | | | | | | | | | | | | WARNING: We need to watch the perf charts when this lands to be sure that it doesn't cause a regression. Since there is no finalizer for a renderer, and some renderers are just terminated with no warning, the only way to get consistent page data is to send it to the browser after each page loads. That is the bulk of this change. I also fixed up a few nits relating to making this work in single process mode. BUG=16495 r=raman.tenneti Review URL: http://codereview.chromium.org/515072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35431 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid calling vector resize() with excessive size parameter: fix broken ↵cevans@chromium.org2009-12-311-6/+13
| | | | | | | | | | | integer overflow checks, or remove resize() calls to simplify non-hot-path cases, or add stronger validations as appropriate. BUG=31364 TEST=NONE Review URL: http://codereview.chromium.org/519031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35414 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup histogram classes mixing SetFlags into FactoryGet argumentsjar@chromium.org2009-12-281-107/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet, along with reformatting. The macros were cleaned up to use common sub-macros rather than repeating code as much. Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros) since this class was not getting used. I introduced UMA_HISTOGRAM_ENUMERATION to support the common use of LinearHistograms to count various enumerated values. I added a Flags argument to all the FactoryGet routines to help avoid needing to call SetFlags each time a new sample is Add()ed. This also simplifies the code. This will all help prepare for a "don't histogram at all" macro setting so that I can test the impact of the histogram macro calls on performance (since there are now so many active histograms). BUG=31206 r=raman.tenneti Review URL: http://codereview.chromium.org/515033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98
* Fix treejar@chromium.org2009-12-151-1/+2
| | | | | | | | | | Avoid carrying across planned to leak flag, which will cause a DCHECK in the browser process. tbr=mbelshe,raman.tenneti Review URL: http://codereview.chromium.org/503016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34575 0039d316-1c4b-4281-b951-d872f2087c98
* Deserialize UMA flag on histograms moving from renderer to browsersjar@chromium.org2009-12-151-0/+1
| | | | | | | | | | | | | | During a recent migration, we forgot to properly resurrect the flags in a histogram as they are carried from the renderer processes into the browser process. Since the flag is the critical marker that identifies which histograms to upload via UMA, this caused renderer histograms to not get reported. BUG=30478 r=raman.tenetti,mbelshe Review URL: http://codereview.chromium.org/505006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34574 0039d316-1c4b-4281-b951-d872f2087c98
* Use factory to create histograms, and refcounts to track lifetimesjar@chromium.org2009-12-061-70/+192
| | | | | | | | | | | | | | | This is CL patch 377028 by Raman Tenneti, with minor changes to make the try-bots happier. It is cleanup that better ensures lifetimes of histograms (making it harder for users to abuse them). bug=16495 (repairs leak induced by the first landing) bug=18840 (should make leaks less possible) tbr=raman.tenneti Review URL: http://codereview.chromium.org/462027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33933 0039d316-1c4b-4281-b951-d872f2087c98
* Add compiler-specific "examine printf format" attributes to printfs.evan@chromium.org2009-11-201-2/+5
| | | | | | | | | | | | Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
* Remove special code fro calculating bucket index in linear histogramsjar@chromium.org2009-10-171-19/+8
| | | | | | | | | | | | | | | | | IMO, the original code was a premature optimization, and worse yet, it had a subtle off by 1 bug due to floating point rounding (which was identified by ERoman.... Thanks!!). This CL removes the special code from linear histograms, and relies on the "standard" binary search approach to locate the correct bucket when a new sample is processed. r=eroman BUG=24160 Review URL: http://codereview.chromium.org/273065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29371 0039d316-1c4b-4281-b951-d872f2087c98
* Automatically adapt to faster/slower uploads of renderer histogramsjar@chromium.org2009-05-281-10/+0
| | | | | | | | | | | | | | | | | | | | | This replaces the current time based approach (chrome is given N seconds to upload all renederer histograms) with an asynch callback approach that waits until all renderers have responded (with their updates). It uses a fall-back timer to ensure that a hung renderer won't delay things forever as well. This causes faster (and complete) updates in about:histograms as well as generally assuring complete updates during UMA gatherings. This code was contributed by Raman Tenneti in CL 42496 http://codereview.chromium.org/42496 bug=12850 r=raman Review URL: http://codereview.chromium.org/113473 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17123 0039d316-1c4b-4281-b951-d872f2087c98
* Remove histogram connection to base classes in stats_counterjar@chromium.org2009-04-101-8/+2
| | | | | | | | | | | | | | | | Now that histograms move data from renderer to browser, there is less reason to connect to stats counters. Stats counters were using shared memory, and now they may plausibly use the histogram's IPC mechanism instead to move data to the browser. The first step is remove the inheritance, and teh next (plausible/future) step would be to implement counters as histograms with only one bucket. r=mbelshe Review URL: http://codereview.chromium.org/66029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13544 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unneeded uses of base/pickle.h. Add some explicit #includes.thestig@chromium.org2009-04-031-0/+1
| | | | | | Review URL: http://codereview.chromium.org/60095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13093 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a bunch of tiny near-bugs and bugs that static analysis identifiedjar@chromium.org2009-03-191-1/+1
| | | | | | | r=mbelshe,brettw Review URL: http://codereview.chromium.org/50014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12166 0039d316-1c4b-4281-b951-d872f2087c98
* Removed unneeded includes of base/scoped_ptr.h. Reduce usage from ~800 files ↵thestig@chromium.org2009-03-131-1/+0
| | | | | | | | to ~400. Review URL: http://codereview.chromium.org/46039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11651 0039d316-1c4b-4281-b951-d872f2087c98
* Initial support for Renderer Side Histogramsjar@chromium.org2009-02-251-26/+174
| | | | | | | | | | Patch contributed by Raman Tenneti see also patch number 21038 Review URL: http://codereview.chromium.org/27034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10330 0039d316-1c4b-4281-b951-d872f2087c98
* Use string for Histogram names since these are all ASCII anyway.dsh@google.com2009-02-241-10/+9
| | | | | | | | Wide-character literals cause problems between platforms. Review URL: http://codereview.chromium.org/28046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10276 0039d316-1c4b-4281-b951-d872f2087c98
* Enhance error report info (and correct typos)jar@chromium.org2009-01-151-3/+3
| | | | | | | r=sky Review URL: http://codereview.chromium.org/18280 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8116 0039d316-1c4b-4281-b951-d872f2087c98
* Report name of repeatedly registered histogramsjar@chromium.org2009-01-141-2/+6
| | | | | | | | | | | | | Histograms should ONLY be listed once in the code for a given process (the browser process?). If two or more histograms have the same name, it is an error, and a DCHECK will fire. This code will also display the name of the offending histogram. r=sky Review URL: http://codereview.chromium.org/16609 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8009 0039d316-1c4b-4281-b951-d872f2087c98
* Remove use of wide characters in stats table identifiers.evanm@google.com2008-11-221-2/+2
| | | | | | | Review URL: http://codereview.chromium.org/11544 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5880 0039d316-1c4b-4281-b951-d872f2087c98
* Rollback "Remove use of wide characters in stats table identifiers."evanm@google.com2008-11-211-2/+2
| | | | | | | This reverts commit r5847. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5850 0039d316-1c4b-4281-b951-d872f2087c98
* Remove use of wide characters in stats table identifiers.evanm@google.com2008-11-211-2/+2
| | | | | | | Review URL: http://codereview.chromium.org/11544 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5847 0039d316-1c4b-4281-b951-d872f2087c98
* Move Time, TimeDelta and TimeTicks into namespace base.dsh@google.com2008-10-271-0/+2
| | | | | | Review URL: http://codereview.chromium.org/7995 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
* Use histograms to send interesting parts of the disk cache statistics.rvargas@google.com2008-09-241-10/+10
| | | | | | | | | | | Most of this CL deals with a derived implementation of histograms that just queries the size stats already generated by the disk cache. The exact number of buckets, and their distribution, is controlled directly by the new class and the disk cache stats code. Review URL: http://codereview.chromium.org/3069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2580 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Define MessagePumpDefault and use it to implement MessageLoop on non-Windowsdarin@google.com2008-08-191-0/+3
| | | | | | | | | | | | | | | | | platforms. This is actually just a first-step toward the real fix which is to use MessagePumpDefault on all platforms on non-UI and non-IO threads. This CL also fixes some GCC compilation errors. I renamed MessageLoopOwnable to TaskBase, which seems more appropriate since a MessageLoopOwnable has a next Task pointer and clearly is only meaningful in the context of Task. (I wonder why it is even a separate class, but that is another issue.) I had to make the next_task / set_next_task methods public since they are used by an inner class of MessageLoop. Perhaps those inner classes should be made into top-level classes, but that seemed like too much to change at this time. R=jar,mmentovai git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1045 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+668
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98