Project

General

Profile

Actions

Bug #13785

open

N+1 warnings when discoverying a host

Added by Lukas Zapletal over 8 years ago. Updated almost 8 years ago.

Status:
Ready For Testing
Priority:
Normal
Category:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

2016-02-18T10:29:50 [app] [W] user: lzap
 | http://localhost:3000/api/v2/discovered_hosts/facts
 | N+1 Query detected
 |   Subnet => [:organizations]
 |   Add to your finder: :includes => [:organizations]
 | N+1 Query method call stack
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:84:in `populate_fields_from_facts'
 |   /home/lzap/work/foreman/app/models/host/base.rb:151:in `import_facts'
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:62:in `import_facts'
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:54:in `import_host_and_facts'
 |   /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:100:in `block in facts'
 |   /home/lzap/work/foreman/app/models/host.rb:15:in `method_missing'
 |   /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:99:in `facts'
 |   /home/lzap/work/foreman/app/controllers/api/v2/base_controller.rb:152:in `disable_json_root'
 |   /home/lzap/work/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 |   /home/lzap/work/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   /home/lzap/work/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
 | 
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:84:in `populate_fields_from_facts'
 | /home/lzap/work/foreman/app/models/host/base.rb:151:in `import_facts'
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:62:in `import_facts'
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:54:in `import_host_and_facts'
 | /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:100:in `block in facts'
 | /home/lzap/work/foreman/app/models/host.rb:15:in `method_missing'
 | /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:99:in `facts'
 | /home/lzap/work/foreman/app/controllers/api/v2/base_controller.rb:152:in `disable_json_root'
 | /home/lzap/work/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 | /home/lzap/work/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 | /home/lzap/work/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
2016-02-18T10:29:50 [app] [W] user: lzap
 | http://localhost:3000/api/v2/discovered_hosts/facts
 | N+1 Query detected
 |   Subnet => [:locations]
 |   Add to your finder: :includes => [:locations]
 | N+1 Query method call stack
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:84:in `populate_fields_from_facts'
 |   /home/lzap/work/foreman/app/models/host/base.rb:151:in `import_facts'
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:62:in `import_facts'
 |   /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:54:in `import_host_and_facts'
 |   /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:100:in `block in facts'
 |   /home/lzap/work/foreman/app/models/host.rb:15:in `method_missing'
 |   /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:99:in `facts'
 |   /home/lzap/work/foreman/app/controllers/api/v2/base_controller.rb:152:in `disable_json_root'
 |   /home/lzap/work/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 |   /home/lzap/work/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 |   /home/lzap/work/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
 | 
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:84:in `populate_fields_from_facts'
 | /home/lzap/work/foreman/app/models/host/base.rb:151:in `import_facts'
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:62:in `import_facts'
 | /home/lzap/work/foreman_discovery/app/models/host/discovered.rb:54:in `import_host_and_facts'
 | /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:100:in `block in facts'
 | /home/lzap/work/foreman/app/models/host.rb:15:in `method_missing'
 | /home/lzap/work/foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb:99:in `facts'
 | /home/lzap/work/foreman/app/controllers/api/v2/base_controller.rb:152:in `disable_json_root'
 | /home/lzap/work/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
 | /home/lzap/work/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 | /home/lzap/work/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'

Actions #1

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/250 added
Actions

Also available in: Atom PDF