Class: SolidStackWeb::MetricsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_stack_web/metrics_controller.rb

Constant Summary

Constants inherited from ApplicationController

ApplicationController::PERIOD_DURATIONS

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/solid_stack_web/metrics_controller.rb', line 3

def index
  queue_stats = QueueStats.new.to_h
  AlertWebhook.check(queue_stats)

  render json: {
    queue:        queue_stats,
    cache:        CacheStats.new.to_h,
    cable:        CableStats.new.to_h,
    generated_at: Time.current.iso8601
  }
end