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

#include <runtime-profile.h>

Inheritance diagram for impala::RuntimeProfile::AveragedCounter:
Collaboration diagram for impala::RuntimeProfile::AveragedCounter:

Public Member Functions

 AveragedCounter (TUnit::type unit)
 
void UpdateCounter (Counter *new_counter)
 
virtual void Set (double value)
 
virtual void Set (int64_t value)
 
virtual void Add (int64_t delta)
 
void BitOr (int64_t delta)
 Use this to update if the counter is a bitmap. More...
 
virtual int64_t value () const
 
virtual double double_value () const
 
TUnit::type unit () const
 

Protected Attributes

AtomicInt< int64_t > value_
 
TUnit::type unit_
 

Private Attributes

boost::unordered_map< Counter
*, int64_t > 
counter_value_map_
 Map from counters to their existing values. Modified via UpdateCounter(). More...
 
double current_double_sum_
 
int64_t current_int_sum_
 

Detailed Description

An AveragedCounter maintains a set of counters and its value is the average of the values in that set. The average is updated through calls to UpdateCounter(), which may add a new counter or update an existing counter. Set() and Add() should not be called.

Definition at line 183 of file runtime-profile.h.

Constructor & Destructor Documentation

impala::RuntimeProfile::AveragedCounter::AveragedCounter ( TUnit::type  unit)
inline

Definition at line 185 of file runtime-profile.h.

Member Function Documentation

virtual void impala::RuntimeProfile::AveragedCounter::Add ( int64_t  delta)
inlinevirtual

Reimplemented from impala::RuntimeProfile::Counter.

Definition at line 228 of file runtime-profile.h.

void impala::RuntimeProfile::Counter::BitOr ( int64_t  delta)
inlineinherited

Use this to update if the counter is a bitmap.

Definition at line 98 of file runtime-profile.h.

References impala::RuntimeProfile::Counter::value_.

Referenced by impala::DiskIoMgr::ReadRange().

virtual double impala::RuntimeProfile::Counter::double_value ( ) const
inlinevirtualinherited

Definition at line 110 of file runtime-profile.h.

References impala::RuntimeProfile::Counter::value_.

Referenced by impala::TEST(), and UpdateCounter().

virtual void impala::RuntimeProfile::AveragedCounter::Set ( double  value)
inlinevirtual

The value for this counter should be updated through UpdateCounter(). Set() and Add() should not be used.

Reimplemented from impala::RuntimeProfile::Counter.

Definition at line 220 of file runtime-profile.h.

virtual void impala::RuntimeProfile::AveragedCounter::Set ( int64_t  value)
inlinevirtual

Reimplemented from impala::RuntimeProfile::Counter.

Definition at line 224 of file runtime-profile.h.

TUnit::type impala::RuntimeProfile::Counter::unit ( ) const
inlineinherited
void impala::RuntimeProfile::AveragedCounter::UpdateCounter ( Counter new_counter)
inline

Update counter_value_map_ with the new counter. This may require the counter to be added to the map. No locks are obtained within this class because UpdateCounter() is called from UpdateAverage(), which obtains locks on the entire counter map in a profile.

Definition at line 195 of file runtime-profile.h.

References counter_value_map_, current_double_sum_, current_int_sum_, impala::RuntimeProfile::Counter::double_value(), impala::RuntimeProfile::Counter::unit_, impala::RuntimeProfile::Counter::value(), and impala::RuntimeProfile::Counter::value_.

Referenced by impala::TEST(), and impala::RuntimeProfile::UpdateAverage().

Member Data Documentation

boost::unordered_map<Counter*, int64_t> impala::RuntimeProfile::AveragedCounter::counter_value_map_
private

Map from counters to their existing values. Modified via UpdateCounter().

Definition at line 234 of file runtime-profile.h.

Referenced by UpdateCounter().

double impala::RuntimeProfile::AveragedCounter::current_double_sum_
private

Current sums of values from counter_value_map_. Only one of these is used, depending on the unit of the counter. current_double_sum_ is used for DOUBLE_VALUE, current_int_sum_ otherwise.

Definition at line 239 of file runtime-profile.h.

Referenced by UpdateCounter().

int64_t impala::RuntimeProfile::AveragedCounter::current_int_sum_
private

Definition at line 240 of file runtime-profile.h.

Referenced by UpdateCounter().

TUnit::type impala::RuntimeProfile::Counter::unit_
protectedinherited

Definition at line 120 of file runtime-profile.h.

Referenced by impala::RuntimeProfile::Counter::unit(), and UpdateCounter().


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