Class: Anomonitor::Collectors::Table
- Defined in:
- lib/anomonitor/collectors/table.rb
Instance Method Summary collapse
- #collect ⇒ Object
-
#initialize(source) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(source) ⇒ Table
Returns a new instance of Table.
6 7 8 |
# File 'lib/anomonitor/collectors/table.rb', line 6 def initialize(source) @source = source end |
Instance Method Details
#collect ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/anomonitor/collectors/table.rb', line 10 def collect klass = @source.model_class if tenant_column?(klass) collect_per_tenant(klass) else metrics_for(klass.all, nil) end rescue NameError => e log_skip("model #{@source.model} not found: #{e.}") [] rescue StandardError => e Anomonitor.logger.warn("[Anomonitor] Table collector (#{@source.name}) error: #{e.}") [] end |