Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <collection-metrics.h>
Public Member Functions | |
StatsMetric (const std::string &key, const TUnit::type unit, const std::string &description="") | |
void | Update (const T &value) |
void | Reset () |
virtual void | ToJson (rapidjson::Document *document, rapidjson::Value *val) |
name, value, human_readable, description More... | |
virtual void | ToLegacyJson (rapidjson::Document *document) |
This method is kept for backwards-compatibility with CM5.0. More... | |
virtual std::string | ToHumanReadable () |
const std::string & | key () const |
const std::string & | description () const |
Protected Member Functions | |
void | AddStandardFields (rapidjson::Document *document, rapidjson::Value *val) |
Protected Attributes | |
const std::string | key_ |
Unique key identifying this metric. More... | |
const std::string | description_ |
Private Types | |
typedef boost::accumulators::accumulator_set < T, boost::accumulators::features < boost::accumulators::tag::mean, boost::accumulators::tag::count, boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::variance > > | Accumulator |
The set of accumulators that update the statistics on each Update() More... | |
Private Attributes | |
TUnit::type | unit_ |
The units of the values captured in this metric, used when pretty-printing. More... | |
boost::mutex | lock_ |
Lock protecting the value and the accumulator_set. More... | |
T | value_ |
The last value. More... | |
Accumulator | acc_ |
Metric which accumulates min, max and mean of all values, plus a count of samples seen. Printed output looks like: name: count: 4, last: 0.0141, min: 4.546e-06, max: 0.0243, mean: 0.0336, stddev: 0.0336 After construction, all statistics are ill-defined, but count will be 0. The first call to Update() will initialise all stats.
Definition at line 107 of file collection-metrics.h.
|
private |
The set of accumulators that update the statistics on each Update()
Definition at line 198 of file collection-metrics.h.
|
inline |
Definition at line 109 of file collection-metrics.h.
|
protectedinherited |
Convenience method to add standard fields (name, description, human readable string) to 'val'.
Definition at line 46 of file metrics.cc.
References impala::name.
Referenced by impala::SetMetric< std::string >::ToJson(), impala::StatsMetric< double >::ToJson(), and impala::SimpleMetric< T, metric_kind >::ToJson().
|
inlineinherited |
Definition at line 72 of file metrics.h.
References impala::Metric::description_.
|
inlineinherited |
Definition at line 71 of file metrics.h.
References impala::Metric::key_.
Referenced by impala::SimpleMetric< T, metric_kind >::Increment().
|
inline |
Definition at line 118 of file collection-metrics.h.
|
inlinevirtual |
Writes a human-readable representation of this metric to 'out'. This is the representation that is often displayed in webpages etc.
Implements impala::Metric.
Definition at line 168 of file collection-metrics.h.
Referenced by impala::TEST().
|
inlinevirtual |
name, value, human_readable, description
Builds a new Value into 'val', using (if required) the allocator from 'document'. Should set the following fields where appropriate:
Implements impala::Metric.
Definition at line 123 of file collection-metrics.h.
|
inlinevirtual |
This method is kept for backwards-compatibility with CM5.0.
Adds a new json value directly to 'document' of the form: "name" : "human-readable-string"
Implements impala::Metric.
Definition at line 147 of file collection-metrics.h.
|
inline |
Definition at line 112 of file collection-metrics.h.
Referenced by impala::ResourceBroker::Expand(), impala::CatalogServer::GatherCatalogUpdatesThread(), impala::StatestoreSubscriber::Heartbeat(), impala::ResourceBroker::LlamaRpc(), impala::RpcEventHandler::postWrite(), impala::ResourceBroker::Reserve(), impala::RequestPoolService::ResolveRequestPool(), impala::Statestore::SendHeartbeat(), impala::Statestore::SendTopicUpdate(), impala::TEST(), impala::StatestoreSubscriber::UpdateState(), and impala::ParallelExecutor::Worker().
|
private |
|
protectedinherited |
Description of this metric. TODO: share one copy amongst metrics with the same description.
Definition at line 80 of file metrics.h.
Referenced by impala::Metric::description().
|
protectedinherited |
Unique key identifying this metric.
Definition at line 76 of file metrics.h.
Referenced by impala::Metric::key(), impala::SetMetric< std::string >::ToLegacyJson(), impala::StatsMetric< double >::ToLegacyJson(), and impala::SimpleMetric< T, metric_kind >::ToLegacyJson().
|
private |
Lock protecting the value and the accumulator_set.
Definition at line 187 of file collection-metrics.h.
Referenced by impala::StatsMetric< double >::Reset(), impala::StatsMetric< double >::ToJson(), impala::StatsMetric< double >::ToLegacyJson(), and impala::StatsMetric< double >::Update().
|
private |
The units of the values captured in this metric, used when pretty-printing.
Definition at line 184 of file collection-metrics.h.
Referenced by impala::StatsMetric< double >::ToHumanReadable(), and impala::StatsMetric< double >::ToJson().
|
private |
The last value.
Definition at line 190 of file collection-metrics.h.
Referenced by impala::StatsMetric< double >::ToHumanReadable(), impala::StatsMetric< double >::ToJson(), impala::StatsMetric< double >::ToLegacyJson(), and impala::StatsMetric< double >::Update().