diff --git a/Gemfile b/Gemfile index 000a20c6..172a072d 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'alma', github: 'tulibraries/alma_rb', branch: 'main' gem 'aws-sdk-s3' gem 'aws-sdk-sqs' gem 'bcrypt_pbkdf' +gem 'benchmark' gem 'bixby', '~> 5.0' gem 'bootstrap-sass', '~> 3.4.1' gem 'capistrano-passenger' diff --git a/Gemfile.lock b/Gemfile.lock index d36a6c0f..8fcb38fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -646,6 +646,7 @@ DEPENDENCIES axe-core-api axe-core-rspec bcrypt_pbkdf + benchmark bixby (~> 5.0) bootstrap-sass (~> 3.4.1) capistrano-passenger diff --git a/lib/tasks/orangeindex.rake b/lib/tasks/orangeindex.rake index 72843112..b818aa12 100644 --- a/lib/tasks/orangeindex.rake +++ b/lib/tasks/orangeindex.rake @@ -108,6 +108,7 @@ namespace :liberate do IndexManager.for(solr_url).index_remaining! end + require 'benchmark' desc "Index single incremental dump uses ENV['DUMP_ID'] (default 1177)" task index_single_dump: :environment do solr_url = "http://lib-solr8d-staging.princeton.edu:8983/solr/catalog-performance" @@ -115,7 +116,11 @@ namespace :liberate do dump_id = dump_id_str.to_i next_dump = Dump.find(dump_id) dump_file = next_dump.dump_files.first - Alma::Indexer::DumpFileIndexer.new(dump_file, solr_url:).index! + puts "!!!!!" + puts "Indexing dump file #{dump_file.id} from dump #{dump_id}" + puts Benchmark.measure { + Alma::Indexer::DumpFileIndexer.new(dump_file, solr_url:).index! + } end desc "Index a single MARC XML file against SET_URL"