V8 Project
v8::internal::HistogramTimer Class Reference

#include <counters.h>

+ Inheritance diagram for v8::internal::HistogramTimer:
+ Collaboration diagram for v8::internal::HistogramTimer:

Public Member Functions

 HistogramTimer ()
 
 HistogramTimer (const char *name, int min, int max, int num_buckets, Isolate *isolate)
 
void Start ()
 
void Stop ()
 
bool Running ()
 
- Public Member Functions inherited from v8::internal::Histogram
 Histogram ()
 
 Histogram (const char *name, int min, int max, int num_buckets, Isolate *isolate)
 
void AddSample (int sample)
 
bool Enabled ()
 
void Reset ()
 

Private Attributes

base::ElapsedTimer timer_
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::Histogram
void * GetHistogram ()
 
const char * name ()
 
Isolateisolate () const
 

Detailed Description

Definition at line 224 of file counters.h.

Constructor & Destructor Documentation

◆ HistogramTimer() [1/2]

v8::internal::HistogramTimer::HistogramTimer ( )
inline

Definition at line 226 of file counters.h.

226 { }

◆ HistogramTimer() [2/2]

v8::internal::HistogramTimer::HistogramTimer ( const char *  name,
int  min,
int  max,
int  num_buckets,
Isolate isolate 
)
inline

Definition at line 227 of file counters.h.

232  : Histogram(name, min, max, num_buckets, isolate) {}
const char * name()
Definition: counters.h:208
Isolate * isolate() const
Definition: counters.h:209
static int min(int a, int b)
Definition: liveedit.cc:273

Member Function Documentation

◆ Running()

bool v8::internal::HistogramTimer::Running ( )
inline

Definition at line 241 of file counters.h.

241  {
242  return Enabled() && timer_.IsStarted();
243  }
base::ElapsedTimer timer_
Definition: counters.h:251

References v8::internal::Histogram::Enabled(), and timer_.

+ Here is the call graph for this function:

◆ Start()

void v8::internal::HistogramTimer::Start ( )

Definition at line 38 of file counters.cc.

38  {
39  if (Enabled()) {
40  timer_.Start();
41  }
42  isolate()->event_logger()(name(), Logger::START);
43 }

References v8::internal::Histogram::Enabled(), v8::internal::Histogram::isolate(), v8::internal::Histogram::name(), v8::internal::Logger::START, and timer_.

Referenced by v8::internal::Parser::ParseLazyFunctionBodyWithPreParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Stop()

void v8::internal::HistogramTimer::Stop ( )

Definition at line 47 of file counters.cc.

47  {
48  if (Enabled()) {
49  // Compute the delta between start and stop, in milliseconds.
50  AddSample(static_cast<int>(timer_.Elapsed().InMilliseconds()));
51  timer_.Stop();
52  }
53  isolate()->event_logger()(name(), Logger::END);
54 }
void AddSample(int sample)
Definition: counters.cc:25

References v8::internal::Histogram::AddSample(), v8::internal::Histogram::Enabled(), v8::internal::Logger::END, v8::internal::Histogram::isolate(), v8::internal::Histogram::name(), and timer_.

Referenced by v8::internal::Parser::ParseLazyFunctionBodyWithPreParser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ timer_

base::ElapsedTimer v8::internal::HistogramTimer::timer_
private

Definition at line 251 of file counters.h.

Referenced by Running(), Start(), and Stop().


The documentation for this class was generated from the following files: