Class: Timescaledb::Stats::Hypertables
- Inherits:
-
Object
- Object
- Timescaledb::Stats::Hypertables
- Defined in:
- lib/timescaledb/stats/hypertables.rb
Instance Method Summary collapse
-
#initialize(hypertables = [], connection = Timescaledb.connection) ⇒ Hypertables
constructor
A new instance of Hypertables.
-
#to_h ⇒ Hash
The hypertables stats.
Constructor Details
#initialize(hypertables = [], connection = Timescaledb.connection) ⇒ Hypertables
Returns a new instance of Hypertables.
8 9 10 11 |
# File 'lib/timescaledb/stats/hypertables.rb', line 8 def initialize(hypertables = [], connection = Timescaledb.connection) @connection = connection @hypertables = hypertables.map(&method('hypertable_name_with_schema')) end |
Instance Method Details
#to_h ⇒ Hash
Returns The hypertables stats.
16 17 18 19 20 21 22 23 24 |
# File 'lib/timescaledb/stats/hypertables.rb', line 16 def to_h { count: @hypertables.count, uncompressed_count: uncompressed_count, approximate_row_count: approximate_row_count, chunks: Timescaledb::Stats::Chunks.new(@hypertables).to_h, size: size } end |