Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: src/d8.h

Issue 67100: Reenable d8 stats timers, using the histogram mechanism (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.h
===================================================================
--- src/d8.h (revision 1693)
+++ src/d8.h (working copy)
@@ -42,11 +42,16 @@
class Counter {
public:
static const int kMaxNameSize = 64;
- int32_t* Bind(const char* name);
- int32_t* ptr() { return &counter_; }
- int32_t value() { return counter_; }
+ int32_t* Bind(const char* name, bool histogram);
+ int32_t* ptr() { return &count_; }
+ int32_t count() { return count_; }
+ int32_t sample_total() { return sample_total_; }
+ bool is_histogram() { return is_histogram_; }
+ void AddSample(int32_t sample);
private:
- int32_t counter_;
+ int32_t count_;
+ int32_t sample_total_;
+ bool is_histogram_;
uint8_t name_[kMaxNameSize];
};
@@ -116,6 +121,11 @@
static void Initialize();
static void OnExit();
static int* LookupCounter(const char* name);
+ static void* CreateHistogram(const char* name,
+ int min,
+ int max,
+ size_t buckets);
+ static void AddHistogramSample(void* histogram, int sample);
static void MapCounters(const char* name);
static Handle<String> ReadFile(const char* name);
static void RunShell();
@@ -179,6 +189,7 @@
static CounterCollection local_counters_;
static CounterCollection* counters_;
static i::OS::MemoryMappedFile* counters_file_;
+ static Counter* GetCounter(const char* name, bool is_histogram);
};
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698