Sha256: 25fe1890cd8059b3ff073836d4b5ca61675a63ce8e70b42d4711e7a4d2985f67

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

module Timescaledb
  class Stats
    class ContinuousAggregates
      # @param [Timescaledb:Connection] connection The PG connection.
      def initialize(connection = Timescaledb.connection)
        @connection = connection
      end

      delegate :query_count, to: :@connection

      # @return [Hash] The continuous_aggregates stats
      def to_h
        { total: total }
      end

      private

      def total
        query_count('SELECT COUNT(1) FROM timescaledb_information.continuous_aggregates')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
timescaledb-0.3.0 lib/timescaledb/stats/continuous_aggregates.rb
timescaledb-0.2.9 lib/timescaledb/stats/continuous_aggregates.rb
timescaledb-0.2.8 lib/timescaledb/stats/continuous_aggregates.rb