Class: SolidObserver::Services::StorageInfoSnapshot::RecordCount

Inherits:
Object
  • Object
show all
Defined in:
lib/solid_observer/services/storage_info_snapshot.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection, table_name) ⇒ RecordCount

Returns a new instance of RecordCount.



9
10
11
12
# File 'lib/solid_observer/services/storage_info_snapshot.rb', line 9

def initialize(connection, table_name)
  @connection = connection
  @table_name = table_name
end

Instance Method Details

#solid_cache_countObject



14
15
16
17
18
19
20
21
# File 'lib/solid_observer/services/storage_info_snapshot.rb', line 14

def solid_cache_count
  case adapter_key
  when :postgresql then postgresql_approximate_count
  when :mysql then mysql_approximate_count
  else
    yield
  end
end