Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::StopWatch Class Reference

#include <stopwatch.h>

Collaboration diagram for impala::StopWatch:

Public Member Functions

 StopWatch ()
 
void Start ()
 
void Stop ()
 
uint64_t ElapsedTime () const
 Returns time in cpu ticks. More...
 

Static Public Member Functions

static uint64_t Rdtsc ()
 

Private Attributes

uint64_t start_
 
uint64_t total_time_
 
bool running_
 

Detailed Description

Utility class to measure time. This is measured using the cpu tick counter which is very low overhead but can be inaccurate if the thread is switched away. This is useful for measuring cpu time at the row batch level (too much overhead at the row granularity).

Definition at line 28 of file stopwatch.h.

Constructor & Destructor Documentation

impala::StopWatch::StopWatch ( )
inline

Definition at line 30 of file stopwatch.h.

References running_, and total_time_.

Member Function Documentation

uint64_t impala::StopWatch::ElapsedTime ( ) const
inline

Returns time in cpu ticks.

Definition at line 50 of file stopwatch.h.

References Rdtsc(), running_, start_, and total_time_.

Referenced by impala::GrowingTest::AggregateTest(), main(), impala::Benchmark::Measure(), Test(), and TimeParallelExecutors().

static uint64_t impala::StopWatch::Rdtsc ( )
inlinestatic

Definition at line 54 of file stopwatch.h.

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

Member Data Documentation

bool impala::StopWatch::running_
private

Definition at line 65 of file stopwatch.h.

Referenced by ElapsedTime(), Start(), Stop(), and StopWatch().

uint64_t impala::StopWatch::start_
private

Definition at line 64 of file stopwatch.h.

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

uint64_t impala::StopWatch::total_time_
private

Definition at line 64 of file stopwatch.h.

Referenced by ElapsedTime(), Stop(), and StopWatch().


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