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

#include <memory-metrics.h>

Inheritance diagram for impala::JvmMetric:
Collaboration diagram for impala::JvmMetric:

Static Public Member Functions

static Status InitMetrics (MetricGroup *metrics)
 

Protected Member Functions

virtual void CalculateValue ()
 

Private Types

enum  JvmMetricType {
  MAX, INIT, COMMITTED, CURRENT,
  PEAK_MAX, PEAK_INIT, PEAK_COMMITTED, PEAK_CURRENT
}
 Each names one of the fields in TJvmMemoryPool. More...
 

Private Member Functions

 JvmMetric (const std::string &key, const std::string &mempool_name, JvmMetricType type)
 Private constructor to ensure only InitMetrics() can create JvmMetrics. More...
 

Private Attributes

std::string mempool_name_
 The name of the memory pool, defined by the Jvm. More...
 
JvmMetricType metric_type_
 

Detailed Description

A JvmMetric corresponds to one value drawn from one 'memory pool' in the JVM. A memory pool is an area of memory assigned for one particular aspect of memory management. For example Hotspot has pools for the permanent generation, the old generation, survivor space, code cache and permanently tenured objects.

Definition at line 84 of file memory-metrics.h.

Member Enumeration Documentation

Each names one of the fields in TJvmMemoryPool.

Enumerator
MAX 
INIT 
COMMITTED 
CURRENT 
PEAK_MAX 
PEAK_INIT 
PEAK_COMMITTED 
PEAK_CURRENT 

Definition at line 97 of file memory-metrics.h.

Constructor & Destructor Documentation

JvmMetric::JvmMetric ( const std::string &  key,
const std::string &  mempool_name,
JvmMetricType  type 
)
private

Private constructor to ensure only InitMetrics() can create JvmMetrics.

Definition at line 58 of file memory-metrics.cc.

References mempool_name_, and metric_type_.

Referenced by InitMetrics().

Member Function Documentation

void JvmMetric::CalculateValue ( )
protectedvirtual

Searches through jvm_metrics_response_ for a matching memory pool and pulls out the right value from that structure according to metric_type_.

Definition at line 102 of file memory-metrics.cc.

References COMMITTED, CURRENT, impala::JniUtil::GetJvmMetrics(), INIT, MAX, mempool_name_, metric_type_, PEAK_COMMITTED, PEAK_CURRENT, PEAK_INIT, PEAK_MAX, and pool.

Status JvmMetric::InitMetrics ( MetricGroup metrics)
static

Registers many Jvm memory metrics: one for every member of JvmMetricType for each pool (usually ~5 pools plus a synthetic 'total' pool).

Definition at line 65 of file memory-metrics.cc.

References COMMITTED, CURRENT, impala::JniUtil::GetJvmMetrics(), INIT, JvmMetric(), MAX, impala::name, impala::Status::OK, PEAK_COMMITTED, PEAK_CURRENT, PEAK_INIT, PEAK_MAX, impala::MetricGroup::RegisterMetric(), and RETURN_IF_ERROR.

Referenced by impala::RegisterMemoryMetrics().

Member Data Documentation

std::string impala::JvmMetric::mempool_name_
private

The name of the memory pool, defined by the Jvm.

Definition at line 112 of file memory-metrics.h.

Referenced by CalculateValue(), and JvmMetric().

JvmMetricType impala::JvmMetric::metric_type_
private

Each metric corresponds to one value; this tells us which value from the memory pool that is.

Definition at line 116 of file memory-metrics.h.

Referenced by CalculateValue(), and JvmMetric().


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