0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
StatsTable.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef Hypertable_Lib_StatsTable_h
23 #define Hypertable_Lib_StatsTable_h
24 
26 
27 #include <string>
28 
29 namespace Hypertable {
30 
31  class StatsTable : public StatsSerializable {
32  public:
33  StatsTable();
35  id = other.id;
36  group_count = other.group_count;
37  memcpy(group_ids, other.group_ids, group_count);
38  table_id = other.table_id;
39  range_count = other.range_count;
41  cell_count = other.cell_count;
42  file_count = other.file_count;
43  scans = other.scans;
48  updates = other.updates;
52  disk_used = other.disk_used;
53  key_bytes = other.key_bytes;
54  value_bytes = other.value_bytes;
56  memory_used = other.memory_used;
63  }
64  void clear();
65  bool operator==(const StatsTable &other) const;
66  bool operator!=(const StatsTable &other) const {
67  return !(*this == other);
68  }
69 
70  std::string table_id;
71  uint32_t range_count;
72  uint32_t scanner_count;
73  uint64_t cell_count;
74  uint64_t file_count;
75  uint64_t scans;
76  uint64_t cells_scanned;
77  uint64_t cells_returned;
78  uint64_t bytes_scanned;
79  uint64_t bytes_returned;
80  uint64_t updates;
81  uint64_t cells_written;
82  uint64_t bytes_written;
83  uint64_t disk_bytes_read;
84  uint64_t disk_used;
85  uint64_t key_bytes;
86  uint64_t value_bytes;
88  uint64_t memory_used;
89  uint64_t memory_allocated;
95 
96  protected:
97  virtual size_t encoded_length_group(int group) const;
98  virtual void encode_group(int group, uint8_t **bufp) const;
99  virtual void decode_group(int group, uint16_t len, const uint8_t **bufp, size_t *remainp);
100  };
101 }
102 
103 
104 #endif // Hypertable_Lib_StatsTable_h
105 
106 
Abstract base class for managing serialized statistics.
virtual void encode_group(int group, uint8_t **bufp) const
Abstruct function to serialize a group into a memory buffer.
Definition: StatsTable.cc:103
Base class managing serialized statistics.
uint64_t block_index_memory
Definition: StatsTable.h:91
uint64_t disk_bytes_read
Definition: StatsTable.h:83
uint64_t memory_allocated
Definition: StatsTable.h:89
virtual void decode_group(int group, uint16_t len, const uint8_t **bufp, size_t *remainp)
Abstruct function to deserialize a group from a memory buffer.
Definition: StatsTable.cc:135
uint64_t bloom_filter_memory
Definition: StatsTable.h:92
uint8_t group_count
Number of groups in group_ids.
StatsTable(const Hypertable::StatsTable &other)
Definition: StatsTable.h:34
std::string table_id
Definition: StatsTable.h:70
uint64_t shadow_cache_memory
Definition: StatsTable.h:90
Hypertable definitions
uint16_t id
The statistics ID.
bool operator==(const StatsTable &other) const
Definition: StatsTable.cc:167
uint8_t group_ids[32]
The actual group IDs.
uint64_t bloom_filter_maybes
Definition: StatsTable.h:94
uint64_t bloom_filter_accesses
Definition: StatsTable.h:93
bool operator!=(const StatsTable &other) const
Definition: StatsTable.h:66
virtual size_t encoded_length_group(int group) const
Abstruct function returning the serialized length of a group.
Definition: StatsTable.cc:69