Class: Gitlab::Database::Partitioning::PartitionMonitoring

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/database/partitioning/partition_monitoring.rb

Instance Method Summary collapse

Instance Method Details

#report_metrics_for_model(model) ⇒ Object


7
8
9
10
11
12
13
# File 'lib/gitlab/database/partitioning/partition_monitoring.rb', line 7

def report_metrics_for_model(model)
  strategy = model.partitioning_strategy

  gauge_present.set({ table: model.table_name }, strategy.current_partitions.size)
  gauge_missing.set({ table: model.table_name }, strategy.missing_partitions.size)
  gauge_extra.set({ table: model.table_name }, strategy.extra_partitions.size)
end