diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-07-10 12:43:51 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-07-11 11:38:12 +0300 |
commit | 56eb9f6c0ee719d06a0cccce8f815922d35b3b05 (patch) | |
tree | d0d1533a6751a0e0e9f9bce00a2c277ba52a7a14 /config | |
parent | 92fac459533d5afeea3b302ca7634767e0ff110b (diff) |
Add `db_spin` and refactor ChaosController
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/config/routes.rb b/config/routes.rb index a42fc037227..6ddfaf741f1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -106,11 +106,14 @@ Rails.application.routes.draw do draw :jira_connect end - if ENV['GITLAB_ENABLE_CHAOS_ENDPOINTS'] - get '/chaos/leakmem' => 'chaos#leakmem' - get '/chaos/cpuspin' => 'chaos#cpuspin' - get '/chaos/sleep' => 'chaos#sleep' - get '/chaos/kill' => 'chaos#kill' + if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? + resource :chaos, only: [] do + get :leakmem + get :cpu_spin + get :db_spin + get :sleep + get :kill + end end end |