Sha256: 639bc5731a78d8eac67c224caa7ea088371857685cd9359f7e6fc1e5d6f5fa88
Contents?: true
Size: 851 Bytes
Versions: 139
Compression:
Stored size: 851 Bytes
Contents
require 'benchmark/benchmark_helper' require 'dynflow/testing' # Add plugin to FactoryBot's paths FactoryBot.definition_file_paths << File.expand_path('../../factories', __FILE__) FactoryBot.reload def generate_hosts(total) FactoryBot.create_list(:host, total, :comment => "benchmark-#{Foreman.uuid}") end Rails.logger.level = Logger::ERROR puts 'generating hosts' generate_hosts(1000) puts 'generating admin user' admin = FactoryBot.build(:user, :admin) admin.save(:validate => false) User.current = admin puts 'starting benchmarking' foreman_benchmark do Benchmark.ips do |x| x.config(:time => 10, :warmup => 0) x.report('rex-targeting-resolve-hosts') do targeting = FactoryBot.create(:targeting, :search_query => "comment = benchmark-#{Foreman.uuid}", :user => User.current) targeting.resolve_hosts! end end end
Version data entries
139 entries across 139 versions & 1 rubygems