Class: Timescaledb::Stats::Chunks

Inherits:
Object
  • Object
show all
Defined in:
lib/timescaledb/stats/chunks.rb

Instance Method Summary collapse

Constructor Details

#initialize(hypertables = [], connection = Timescaledb.connection) ⇒ Chunks

Returns a new instance of Chunks.

Parameters:

  • hypertables (Array<String>) (defaults to: [])

    The list of hypertable names.

  • connection (Timescaledb:Connection) (defaults to: Timescaledb.connection)

    The PG connection.



6
7
8
9
# File 'lib/timescaledb/stats/chunks.rb', line 6

def initialize(hypertables = [], connection = Timescaledb.connection)
  @connection = connection
  @hypertables = hypertables
end

Instance Method Details

#to_hHash

Returns The chunks stats.

Returns:

  • (Hash)

    The chunks stats



14
15
16
# File 'lib/timescaledb/stats/chunks.rb', line 14

def to_h
  { total: total, compressed: compressed, uncompressed: uncompressed }
end