Class: Timescaledb::Stats::JobStats

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

Instance Method Summary collapse

Constructor Details

#initialize(connection = Timescaledb.connection) ⇒ JobStats

Returns a new instance of JobStats.

Parameters:

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

    The PG connection.



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

def initialize(connection = Timescaledb.connection)
  @connection = connection
end

Instance Method Details

#to_hHash

Returns The job_stats stats.

Returns:

  • (Hash)

    The job_stats stats



13
14
15
# File 'lib/timescaledb/stats/job_stats.rb', line 13

def to_h
  query_first(job_stats_query).to_h.transform_values(&:to_i)
end