Class: Timescaledb::Stats

Inherits:
Object
  • Object
show all
Defined in:
lib/timescaledb/stats.rb,
lib/timescaledb/stats/chunks.rb,
lib/timescaledb/stats/job_stats.rb,
lib/timescaledb/stats/hypertables.rb,
lib/timescaledb/stats/continuous_aggregates.rb

Defined Under Namespace

Classes: Chunks, ContinuousAggregates, Hypertables, JobStats

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Stats.

Parameters:

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

    The list of hypertables.

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

    The PG connection.



9
10
11
12
# File 'lib/timescaledb/stats.rb', line 9

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

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
# File 'lib/timescaledb/stats.rb', line 14

def to_h
  {
    hypertables: Hypertables.new(@hypertables).to_h,
    continuous_aggregates: ContinuousAggregates.new.to_h,
    jobs_stats: JobStats.new.to_h
  }
end