Module: BWStatusBoardAPI::Client::Metrics
- Includes:
- Boards, Environments, Environments::Services, Helpers
- Included in:
- BWStatusBoardAPI::Client
- Defined in:
- lib/bw_status_board_api/client/metrics.rb
Overview
Metrics module
Instance Method Summary collapse
-
#total_boards ⇒ Integer
Returns total boards.
-
#total_environment_services(environment_id) ⇒ Integer
Returns total services for environment.
-
#total_environments ⇒ Integer
Returns total environments.
-
#total_failing_environments ⇒ Integer
Returns total failing environments.
-
#total_failing_services ⇒ Integer
Returns total failing services.
-
#total_partially_successful_environments ⇒ Integer
Returns total partially successful environments.
-
#total_services ⇒ Integer
Returns total services.
-
#total_successful_environments ⇒ Integer
Returns total successful environments.
-
#total_successful_services ⇒ Integer
Returns total successful services.
Methods included from Helpers
Methods included from Environments::Services
#create_service, #delete_service, #failing_services, #patch_service, #service, #services, #services_summary, #successful_services, #update_service
Methods included from Environments
#create_environment, #delete_environment, #environment, #environments, #environments_summary, #failing_environments, #partially_successful_environments, #patch_environment, #successful_environments, #update_environment
Methods included from Boards
#board, #boards, #boards_summary, #create_board, #delete_board, #patch_board, #update_board
Instance Method Details
#total_boards ⇒ Integer
Returns total boards
18 19 20 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 18 def total_boards boards['results'].size end |
#total_environment_services(environment_id) ⇒ Integer
Returns total services for environment
61 62 63 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 61 def total_environment_services(environment_id) services(environment_id)['results'].size end |
#total_environments ⇒ Integer
Returns total environments
25 26 27 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 25 def total_environments environments['results'].size end |
#total_failing_environments ⇒ Integer
Returns total failing environments
32 33 34 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 32 def total_failing_environments filter(environments['results'], false, 'status', 'failure').size end |
#total_failing_services ⇒ Integer
Returns total failing services
68 69 70 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 68 def total_failing_services filter(all_services, false, 'status', 'failure').size end |
#total_partially_successful_environments ⇒ Integer
Returns total partially successful environments
39 40 41 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 39 def total_partially_successful_environments filter(environments['results'], false, 'status', 'partialSuccess').size end |
#total_services ⇒ Integer
Returns total services
53 54 55 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 53 def total_services environments['results'].map { |environment| environment['services'].size }.inject(:+) end |
#total_successful_environments ⇒ Integer
Returns total successful environments
46 47 48 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 46 def total_successful_environments filter(environments['results'], false, 'status', 'success').size end |
#total_successful_services ⇒ Integer
Returns total successful services
75 76 77 |
# File 'lib/bw_status_board_api/client/metrics.rb', line 75 def total_successful_services filter(all_services, false, 'status', 'success').size end |