Class: ChaosController

Inherits:
BaseActionController show all
Defined in:
app/controllers/chaos_controller.rb

Instance Method Summary collapse

Methods included from ContentSecurityPolicyPatch

#content_security_policy_with_context

Instance Method Details

#cpu_spinObject



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

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

#db_spinObject



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

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

#gcObject



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

def gc
  gc_stat = Gitlab::Chaos.run_gc

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

#killObject



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

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

#leakmemObject



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

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

#quitObject



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

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

#sleepObject



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

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