Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impalad-metrics.cc
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "util/impalad-metrics.h"
16 
17 #include "util/debug-util.h"
18 
19 #include "common/names.h"
20 
21 namespace impala {
22 
23 // Naming convention: Components should be separated by '.' and words should
24 // be separated by '-'.
26  "impala-server.start-time";
28  "impala-server.version";
30  "impala-server.ready";
32  "impala-server.num-queries";
34  "impala-server.num-fragments";
36  "impala-server.scan-ranges.total";
38  "impala-server.scan-ranges.num-missing-volume-id";
40  "impala-server.mem-pool.total-bytes";
42  "impala-server.hash-table.total-bytes";
44  "impala-server.io-mgr.num-open-files";
46  "impala-server.io-mgr.num-buffers";
48  "impala-server.io-mgr.total-bytes";
50  "impala-server.io-mgr.num-unused-buffers";
52  "impala-server.io-mgr.bytes-read";
54  "impala-server.io-mgr.local-bytes-read";
56  "impala-server.io-mgr.short-circuit-bytes-read";
58  "impala-server.io-mgr.cached-bytes-read";
60  "impala-server.io-mgr.bytes-written";
62  "catalog.num-databases";
64  "catalog.num-tables";
66  "catalog.ready";
68  "impala-server.num-files-open-for-insert";
70  "impala-server.num-open-hiveserver2-sessions";
72  "impala-server.num-open-beeswax-sessions";
74  "impala-server.num-sessions-expired";
76  "impala-server.num-queries-expired";
78  "impala-server.num-queries-spilled";
80  "impala-server.resultset-cache.total-num-rows";
82  "impala-server.resultset-cache.total-bytes";
83 
84 // These are created by impala-server during startup.
85 // =======
86 // Counters
95 
96 // Gauges
114 
115 // Properties
120 
122  // Initialize impalad metrics
125  IMPALA_SERVER_VERSION = m->AddProperty<string>(
127  IMPALA_SERVER_READY = m->AddProperty<bool>(
129 
148 
149  // Initialize scan node metrics
154 
155  // Initialize memory usage metrics
156  MEM_POOL_TOTAL_BYTES = m->AddGauge<int64_t>(
157  ImpaladMetricKeys::MEM_POOL_TOTAL_BYTES, 0L, TUnit::BYTES);
160 
161  // Initialize insert metrics
162  NUM_FILES_OPEN_FOR_INSERT = m->AddGauge<int64_t>(
164 
165  // Initialize IO mgr metrics
166  IO_MGR_NUM_OPEN_FILES = m->AddGauge<int64_t>(
168  IO_MGR_NUM_BUFFERS = m->AddGauge<int64_t>(
170  IO_MGR_TOTAL_BYTES = m->AddGauge<int64_t>(
171  ImpaladMetricKeys::IO_MGR_TOTAL_BYTES, 0L, TUnit::BYTES);
172  IO_MGR_NUM_UNUSED_BUFFERS = m->AddGauge<int64_t>(
174 
176  ImpaladMetricKeys::IO_MGR_BYTES_READ, 0L, TUnit::BYTES);
179  IO_MGR_CACHED_BYTES_READ = m->AddGauge<int64_t>(
183  IO_MGR_BYTES_WRITTEN = m->AddGauge<int64_t>(
184  ImpaladMetricKeys::IO_MGR_BYTES_WRITTEN, 0L, TUnit::BYTES);
185 
186  // Initialize catalog metrics
187  CATALOG_NUM_DBS = m->AddGauge<int64_t>(
189  CATALOG_NUM_TABLES = m->AddGauge<int64_t>(
191  CATALOG_READY = m->AddProperty<bool>(
193 }
194 
195 }
SimpleMetric< T, TMetricKind::COUNTER > * AddCounter(const std::string &key, const T &value, const TUnit::type unit=TUnit::UNIT, const std::string &description="")
Definition: metrics.h:239
static const char * MEM_POOL_TOTAL_BYTES
Number of bytes currently in use across all mem pools.
static const char * IMPALA_SERVER_NUM_OPEN_BEESWAX_SESSIONS
Number of open Beeswax sessions.
static IntGauge * IMPALA_SERVER_NUM_OPEN_HS2_SESSIONS
static IntGauge * RESULTSET_CACHE_TOTAL_NUM_ROWS
static StringProperty * IMPALA_SERVER_VERSION
static IntGauge * IO_MGR_TOTAL_BYTES
class SimpleMetric< std::string, TMetricKind::PROPERTY > StringProperty
Definition: metrics.h:323
static const char * IO_MGR_SHORT_CIRCUIT_BYTES_READ
Total number of short-circuit bytes read by the io mgr.
static const char * IO_MGR_CACHED_BYTES_READ
Total number of cached bytes read by the io mgr.
static void CreateMetrics(MetricGroup *m)
static const char * NUM_QUERIES_EXPIRED
Number of queries expired due to inactivity.
static IntGauge * IO_MGR_NUM_UNUSED_BUFFERS
static IntGauge * IO_MGR_BYTES_WRITTEN
string GetVersionString(bool compact)
Returns "<program short name> version <GetBuildVersion(compact)>".
Definition: debug-util.cc:239
class SimpleMetric< int64_t, TMetricKind::COUNTER > IntCounter
Definition: metrics.h:320
static const char * CATALOG_NUM_DBS
Number of DBs in the catalog.
static IntGauge * IO_MGR_NUM_OPEN_FILES
static IntGauge * MEM_POOL_TOTAL_BYTES
MetricGroups may be organised hierarchically as a tree.
Definition: metrics.h:200
static const char * TOTAL_SCAN_RANGES_PROCESSED
Number of scan ranges processed.
static const char * IMPALA_SERVER_START_TIME
Local time that the server started.
static const char * RESULTSET_CACHE_TOTAL_NUM_ROWS
Total number of rows cached to support HS2 FETCH_FIRST.
static const char * IMPALA_SERVER_NUM_QUERIES
static IntGauge * IO_MGR_BYTES_READ
static const char * IMPALA_SERVER_READY
True if Impala has finished initialisation.
static const char * IMPALA_SERVER_VERSION
Full version string of the Impala server.
static const char * IO_MGR_LOCAL_BYTES_READ
Total number of local bytes read by the io mgr.
static const char * IO_MGR_NUM_OPEN_FILES
Number of files currently opened by the io mgr.
static const char * RESULTSET_CACHE_TOTAL_BYTES
Total bytes consumed for rows cached to support HS2 FETCH_FIRST.
static IntGauge * CATALOG_NUM_TABLES
static const char * IO_MGR_NUM_UNUSED_BUFFERS
Number of IO buffers that are currently unused (and can be GC'ed)
static const char * IO_MGR_NUM_BUFFERS
Number of IO buffers allocated by the io mgr.
static IntGauge * RESULTSET_CACHE_TOTAL_BYTES
static IntGauge * NUM_FILES_OPEN_FOR_INSERT
static const char * HASH_TABLE_TOTAL_BYTES
Number of bytes currently in use across all hash tables.
static IntCounter * NUM_RANGES_MISSING_VOLUME_ID
static BooleanProperty * CATALOG_READY
static IntCounter * IMPALA_SERVER_NUM_QUERIES
static const char * IO_MGR_TOTAL_BYTES
Number of bytes used by IO buffers (used and unused).
static IntCounter * NUM_RANGES_PROCESSED
static IntCounter * NUM_SESSIONS_EXPIRED
SimpleMetric< T, TMetricKind::PROPERTY > * AddProperty(const std::string &key, const T &value, const std::string &description="")
Definition: metrics.h:231
static IntGauge * IO_MGR_SHORT_CIRCUIT_BYTES_READ
static IntCounter * IMPALA_SERVER_NUM_FRAGMENTS
static IntCounter * NUM_QUERIES_SPILLED
static const char * CATALOG_READY
static const char * CATALOG_NUM_TABLES
Number of tables in the catalog.
static const char * IO_MGR_BYTES_READ
Total number of bytes read by the io mgr.
static IntCounter * NUM_QUERIES_EXPIRED
static IntGauge * IO_MGR_CACHED_BYTES_READ
static const char * NUM_SCAN_RANGES_MISSING_VOLUME_ID
Number of scan ranges with missing volume id metadata.
static IntGauge * IO_MGR_NUM_BUFFERS
static BooleanProperty * IMPALA_SERVER_READY
class SimpleMetric< bool, TMetricKind::PROPERTY > BooleanProperty
Definition: metrics.h:322
static IntGauge * IMPALA_SERVER_NUM_OPEN_BEESWAX_SESSIONS
SimpleMetric< T > * AddGauge(const std::string &key, const T &value, const TUnit::type unit=TUnit::NONE, const std::string &description="")
Create a gauge metric object with given key and initial value (owned by this object) ...
Definition: metrics.h:223
static StringProperty * IMPALA_SERVER_START_TIME
static const char * NUM_QUERIES_SPILLED
Number of queries that spilled.
static const char * IO_MGR_BYTES_WRITTEN
Total number of bytes written to disk by the io mgr (for spilling)
static const char * IMPALA_SERVER_NUM_FRAGMENTS
static IntGauge * HASH_TABLE_TOTAL_BYTES
static IntGauge * IO_MGR_LOCAL_BYTES_READ
static const char * NUM_FILES_OPEN_FOR_INSERT
Number of files open for insert.
static IntGauge * CATALOG_NUM_DBS
static const char * IMPALA_SERVER_NUM_OPEN_HS2_SESSIONS
Number of open HiveServer2 sessions.
static const char * NUM_SESSIONS_EXPIRED
Number of sessions expired due to inactivity.