Class: ChaosController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/chaos_controller.rb

Overview

rubocop:disable Rails/ApplicationController

Instance Method Summary collapse

Instance Method Details

#cpu_spinObject



11
12
13
# File 'app/controllers/chaos_controller.rb', line 11

def cpu_spin
  do_chaos :cpu_spin, Chaos::CpuSpinWorker, duration_s
end

#db_spinObject



15
16
17
# File 'app/controllers/chaos_controller.rb', line 15

def db_spin
  do_chaos :db_spin, Chaos::DbSpinWorker, duration_s, interval_s
end

#gcObject



31
32
33
34
35
36
37
38
# File 'app/controllers/chaos_controller.rb', line 31

def gc
  gc_stat = Gitlab::Chaos.run_gc

  render json: {
    worker_id: ::Prometheus::PidProvider.worker_id,
    gc_stat: gc_stat
  }
end

#killObject



23
24
25
# File 'app/controllers/chaos_controller.rb', line 23

def kill
  do_chaos :kill, Chaos::KillWorker, 'KILL'
end

#leakmemObject



7
8
9
# File 'app/controllers/chaos_controller.rb', line 7

def leakmem
  do_chaos :leak_mem, Chaos::LeakMemWorker, memory_mb, duration_s
end

#quitObject



27
28
29
# File 'app/controllers/chaos_controller.rb', line 27

def quit
  do_chaos :kill, Chaos::KillWorker, 'QUIT'
end

#sleepObject



19
20
21
# File 'app/controllers/chaos_controller.rb', line 19

def sleep
  do_chaos :sleep, Chaos::SleepWorker, duration_s
end