qa_server 7.2.0 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop_fixme.yml +6 -0
- data/.travis.yml +4 -5
- data/CHANGELOG.md +38 -0
- data/Rakefile +1 -1
- data/app/assets/stylesheets/qa_server/_check-status.scss +36 -0
- data/app/cache_processors/concerns/qa_server/cache_keys.rb +0 -5
- data/app/cache_processors/qa_server/cache_expiry_service.rb +13 -8
- data/app/cache_processors/qa_server/job_id_cache.rb +29 -0
- data/app/cache_processors/qa_server/performance_cache.rb +34 -34
- data/app/cache_processors/qa_server/performance_day_graph_cache.rb +27 -0
- data/app/cache_processors/qa_server/performance_month_graph_cache.rb +27 -0
- data/app/cache_processors/qa_server/performance_year_graph_cache.rb +27 -0
- data/app/cache_processors/qa_server/scenario_history_cache.rb +7 -7
- data/app/cache_processors/qa_server/scenario_history_graph_cache.rb +12 -17
- data/app/cache_processors/qa_server/scenario_run_cache.rb +8 -8
- data/app/cache_processors/qa_server/scenario_run_failures_cache.rb +7 -7
- data/app/cache_processors/qa_server/scenario_run_summary_cache.rb +7 -7
- data/app/controllers/concerns/qa_server/authority_validation_behavior.rb +49 -44
- data/app/controllers/qa_server/check_status_controller.rb +92 -22
- data/app/controllers/qa_server/fetch_controller.rb +36 -36
- data/app/controllers/qa_server/monitor_status_controller.rb +105 -105
- data/app/jobs/qa_server/history_graph_job.rb +28 -0
- data/app/jobs/qa_server/monitor_tests_job.rb +19 -39
- data/app/jobs/qa_server/performance_day_graph_job.rb +45 -0
- data/app/jobs/qa_server/performance_month_graph_job.rb +45 -0
- data/app/jobs/qa_server/performance_per_byte_job.rb +85 -0
- data/app/jobs/qa_server/performance_year_graph_job.rb +45 -0
- data/app/loggers/qa_server/scenario_logger.rb +74 -4
- data/app/models/concerns/qa_server/performance_history_data_keys.rb +8 -0
- data/app/models/qa_server/authority_scenario.rb +4 -4
- data/app/models/qa_server/authority_status.rb +2 -2
- data/app/models/qa_server/authority_status_failure.rb +1 -1
- data/app/models/qa_server/performance_history.rb +2 -2
- data/app/models/qa_server/scenario_run_history.rb +52 -52
- data/app/models/qa_server/scenario_run_registry.rb +2 -2
- data/app/models/qa_server/scenarios.rb +26 -26
- data/app/models/qa_server/search_scenario.rb +18 -13
- data/app/models/qa_server/term_scenario.rb +29 -29
- data/app/prepends/prepended_linked_data/find_term.rb +40 -40
- data/app/prepends/prepended_linked_data/search_query.rb +36 -36
- data/app/prepends/prepended_rdf/rdf_graph.rb +7 -7
- data/app/presenters/concerns/qa_server/monitor_status/performance_datatable_behavior.rb +32 -32
- data/app/presenters/concerns/qa_server/monitor_status/performance_graph_behavior.rb +64 -64
- data/app/presenters/qa_server/check_status_presenter.rb +63 -7
- data/app/services/concerns/qa_server/gruff_graph.rb +16 -16
- data/app/services/qa_server/authority_loader_service.rb +14 -14
- data/app/services/qa_server/authority_validator_service.rb +1 -0
- data/app/services/qa_server/database_migrator.rb +14 -14
- data/app/services/qa_server/history_graphing_service.rb +30 -30
- data/app/services/qa_server/performance_calculator_service.rb +80 -80
- data/app/services/qa_server/performance_datatable_service.rb +35 -35
- data/app/services/qa_server/performance_graph_data_service.rb +28 -28
- data/app/services/qa_server/performance_graphing_service.rb +58 -58
- data/app/services/qa_server/performance_per_byte_calculator_service.rb +88 -0
- data/app/services/qa_server/performance_per_byte_data_service.rb +41 -0
- data/app/services/qa_server/scenarios_loader_service.rb +1 -1
- data/app/services/qa_server/time_period_service.rb +21 -21
- data/app/validators/qa_server/scenario_validator.rb +99 -87
- data/app/validators/qa_server/search_scenario_validator.rb +67 -61
- data/app/validators/qa_server/term_scenario_validator.rb +20 -15
- data/app/views/qa_server/check_status/index.html.erb +120 -24
- data/config/i18n-tasks.yml +133 -0
- data/config/locales/qa_server.en.yml +15 -0
- data/lib/generators/qa_server/assets_generator.rb +4 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/cerl_ld4l_cache.json +2 -2
- data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_aat_ld4l_cache.json +62 -1
- data/lib/generators/qa_server/templates/config/authorities/linked_data/getty_tgn_ld4l_cache.json +28 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/isni_ld4l_cache.json +90 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/ligatus_ld4l_cache.json +133 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo2_ld4l_cache.json +248 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo3_ld4l_cache.json +248 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/locvocabs_ld4l_cache.json +117 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/mesh_nlm_ld4l_cache.json +135 -3
- data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_direct.json +1 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/oclcfast_ld4l_cache.json +1 -4
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/agrovoc_direct_validation.yml +31 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/agrovoc_ld4l_cache_validation.yml +31 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/cerl_ld4l_cache_validation.yml +23 -11
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/dbpedia_ld4l_cache_validation.yml +33 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/geonames_direct_validation.yml +35 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/geonames_ld4l_cache_validation.yml +58 -5
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_aat_ld4l_cache_validation.yml +256 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_tgn_ld4l_cache_validation.yml +35 -1
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_ulan_ld4l_cache_validation.yml +37 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/isni_ld4l_cache_validation.yml +10 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/ligatus_ld4l_cache_validation.yml +36 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locdemographics_ld4l_cache_validation.yml +73 -44
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locgenres_ld4l_cache_validation.yml +31 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_ld4l_cache_validation.yml +71 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_rwo_ld4l_cache_validation.yml +70 -2
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locperformance_ld4l_cache_validation.yml +6 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locsubjects_ld4l_cache_validation.yml +32 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locvocabs_ld4l_cache_validation.yml +184 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/mesh_nlm_ld4l_cache_validation.yml +51 -1
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/nalt_ld4l_cache_validation.yml +37 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclc_fast_validation.yml +71 -5
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_direct_validation.yml +66 -1
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/oclcfast_ld4l_cache_validation.yml +57 -0
- data/lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/rda_registry_ld4l_cache_validation.yml +310 -0
- data/lib/qa_server/configuration.rb +28 -24
- data/lib/qa_server/version.rb +1 -1
- data/qa_server.gemspec +2 -1
- data/spec/feature/accuracy_spec.rb +32 -0
- data/spec/i18n_spec.rb +36 -0
- data/spec/spec_helper.rb +4 -0
- metadata +46 -12
- data/app/cache_processors/qa_server/performance_daily_graph_cache.rb +0 -60
- data/app/cache_processors/qa_server/performance_hourly_graph_cache.rb +0 -65
- data/app/cache_processors/qa_server/performance_monthly_graph_cache.rb +0 -60
data/lib/qa_server/version.rb
CHANGED
data/qa_server.gemspec
CHANGED
|
@@ -34,13 +34,14 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
|
|
35
35
|
spec.add_development_dependency 'better_errors' # provide debugging command line in
|
|
36
36
|
spec.add_development_dependency 'binding_of_caller' # provides deep stack info used by better_errors
|
|
37
|
-
spec.add_development_dependency 'bixby', '~>
|
|
37
|
+
spec.add_development_dependency 'bixby', '~> 3.0.0' # rubocop styleguide
|
|
38
38
|
# spec.add_development_dependency "capybara", '~> 3.29'
|
|
39
39
|
# spec.add_development_dependency 'capybara-maleficent', '~> 0.3.0'
|
|
40
40
|
# spec.add_development_dependency 'chromedriver-helper', '~> 2.1'
|
|
41
41
|
spec.add_development_dependency 'deprecation'
|
|
42
42
|
spec.add_development_dependency 'engine_cart', '~> 2.0'
|
|
43
43
|
spec.add_development_dependency "factory_bot", '~> 4.4'
|
|
44
|
+
spec.add_development_dependency 'i18n-tasks'
|
|
44
45
|
spec.add_development_dependency 'simplecov'
|
|
45
46
|
spec.add_development_dependency 'sqlite3'
|
|
46
47
|
spec.add_development_dependency 'rails-controller-testing', '~> 1'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require 'spec_helper'
|
|
3
|
+
|
|
4
|
+
# rubocop:disable RSpec/InstanceVariable
|
|
5
|
+
RSpec.describe 'Accuracy test' do # rubocop:disable RSpec/DescribeClass
|
|
6
|
+
before(:all) { WebMock.allow_net_connect! }
|
|
7
|
+
after(:all) { WebMock.disable_net_connect! }
|
|
8
|
+
|
|
9
|
+
let(:authority_list) { QaServer::AuthorityListerService.authorities_list }
|
|
10
|
+
let(:authority_name) { :CERL_LD4L_CACHE }
|
|
11
|
+
|
|
12
|
+
describe 'for authority:' do
|
|
13
|
+
@status_log = QaServer::ScenarioLogger.new
|
|
14
|
+
QaServer::AuthorityListerService.authorities_list.each do |authority_name| # rubocop:disable Style/MultilineIfModifier
|
|
15
|
+
QaServer::AuthorityValidatorService.run(authority_name: authority_name,
|
|
16
|
+
status_log: @status_log,
|
|
17
|
+
validation_type: QaServer::ScenarioValidator::VALIDATE_ACCURACY)
|
|
18
|
+
end unless ENV['TRAVIS']
|
|
19
|
+
@status_log.each do |test_result|
|
|
20
|
+
context "#{test_result[:authority_name]}:#{test_result[:subauthority_name]}:#{test_result[:request_data]}:" do
|
|
21
|
+
it "finds actual <= expected" do
|
|
22
|
+
pending 'test is known to fail' if test_result[:pending]
|
|
23
|
+
expect(test_result[:err_message]).to be_empty
|
|
24
|
+
expect(test_result[:request_data]).not_to be_empty
|
|
25
|
+
expect(test_result[:actual]).not_to be_nil
|
|
26
|
+
expect(test_result[:actual]).to be <= test_result[:expected]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
# rubocop:enable RSpec/InstanceVariable
|
data/spec/i18n_spec.rb
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'i18n/tasks'
|
|
4
|
+
|
|
5
|
+
RSpec.describe I18n do
|
|
6
|
+
let(:i18n) { I18n::Tasks::BaseTask.new }
|
|
7
|
+
let(:missing_keys) { i18n.missing_keys }
|
|
8
|
+
let(:unused_keys) { i18n.unused_keys }
|
|
9
|
+
let(:inconsistent_interpolations) { i18n.inconsistent_interpolations }
|
|
10
|
+
|
|
11
|
+
it 'does not have missing keys' do
|
|
12
|
+
expect(missing_keys).to be_empty,
|
|
13
|
+
"Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'does not have unused keys' do
|
|
17
|
+
pending 'need to explore unused keys further'
|
|
18
|
+
expect(unused_keys).to be_empty,
|
|
19
|
+
"#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'files are normalized' do # rubocop:disable RSpec/ExampleLength
|
|
23
|
+
pending 'need to explore further normalization process'
|
|
24
|
+
non_normalized = i18n.non_normalized_paths
|
|
25
|
+
error_message = "The following files need to be normalized:\n" \
|
|
26
|
+
"#{non_normalized.map { |path| " #{path}" }.join("\n")}\n" \
|
|
27
|
+
"Please run `i18n-tasks normalize' to fix"
|
|
28
|
+
expect(non_normalized).to be_empty, error_message
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'does not have inconsistent interpolations' do
|
|
32
|
+
error_message = "#{inconsistent_interpolations.leaves.count} i18n keys have inconsistent interpolations.\n" \
|
|
33
|
+
"Run `i18n-tasks check-consistent-interpolations' to show them"
|
|
34
|
+
expect(inconsistent_interpolations).to be_empty, error_message
|
|
35
|
+
end
|
|
36
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: qa_server
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- E. Lynette Rayle
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-12-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -114,14 +114,14 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
117
|
+
version: 3.0.0
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
124
|
+
version: 3.0.0
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: deprecation
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -164,6 +164,20 @@ dependencies:
|
|
|
164
164
|
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '4.4'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: i18n-tasks
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - ">="
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - ">="
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '0'
|
|
167
181
|
- !ruby/object:Gem::Dependency
|
|
168
182
|
name: simplecov
|
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -340,11 +354,12 @@ files:
|
|
|
340
354
|
- app/assets/stylesheets/qa_server/_usage.scss
|
|
341
355
|
- app/cache_processors/concerns/qa_server/cache_keys.rb
|
|
342
356
|
- app/cache_processors/qa_server/cache_expiry_service.rb
|
|
357
|
+
- app/cache_processors/qa_server/job_id_cache.rb
|
|
343
358
|
- app/cache_processors/qa_server/performance_cache.rb
|
|
344
|
-
- app/cache_processors/qa_server/performance_daily_graph_cache.rb
|
|
345
359
|
- app/cache_processors/qa_server/performance_datatable_cache.rb
|
|
346
|
-
- app/cache_processors/qa_server/
|
|
347
|
-
- app/cache_processors/qa_server/
|
|
360
|
+
- app/cache_processors/qa_server/performance_day_graph_cache.rb
|
|
361
|
+
- app/cache_processors/qa_server/performance_month_graph_cache.rb
|
|
362
|
+
- app/cache_processors/qa_server/performance_year_graph_cache.rb
|
|
348
363
|
- app/cache_processors/qa_server/scenario_history_cache.rb
|
|
349
364
|
- app/cache_processors/qa_server/scenario_history_graph_cache.rb
|
|
350
365
|
- app/cache_processors/qa_server/scenario_run_cache.rb
|
|
@@ -357,7 +372,12 @@ files:
|
|
|
357
372
|
- app/controllers/qa_server/homepage_controller.rb
|
|
358
373
|
- app/controllers/qa_server/monitor_status_controller.rb
|
|
359
374
|
- app/controllers/qa_server/usage_controller.rb
|
|
375
|
+
- app/jobs/qa_server/history_graph_job.rb
|
|
360
376
|
- app/jobs/qa_server/monitor_tests_job.rb
|
|
377
|
+
- app/jobs/qa_server/performance_day_graph_job.rb
|
|
378
|
+
- app/jobs/qa_server/performance_month_graph_job.rb
|
|
379
|
+
- app/jobs/qa_server/performance_per_byte_job.rb
|
|
380
|
+
- app/jobs/qa_server/performance_year_graph_job.rb
|
|
361
381
|
- app/loggers/qa_server/scenario_logger.rb
|
|
362
382
|
- app/models/concerns/qa_server/performance_history_data_keys.rb
|
|
363
383
|
- app/models/qa_server/authority_scenario.rb
|
|
@@ -393,6 +413,8 @@ files:
|
|
|
393
413
|
- app/services/qa_server/performance_datatable_service.rb
|
|
394
414
|
- app/services/qa_server/performance_graph_data_service.rb
|
|
395
415
|
- app/services/qa_server/performance_graphing_service.rb
|
|
416
|
+
- app/services/qa_server/performance_per_byte_calculator_service.rb
|
|
417
|
+
- app/services/qa_server/performance_per_byte_data_service.rb
|
|
396
418
|
- app/services/qa_server/scenarios_loader_service.rb
|
|
397
419
|
- app/services/qa_server/time_period_service.rb
|
|
398
420
|
- app/services/qa_server/time_service.rb
|
|
@@ -410,6 +432,7 @@ files:
|
|
|
410
432
|
- app/views/qa_server/monitor_status/index.html.erb
|
|
411
433
|
- app/views/qa_server/usage/index.html.erb
|
|
412
434
|
- app/views/shared/_footer.html.erb
|
|
435
|
+
- config/i18n-tasks.yml
|
|
413
436
|
- config/locales/qa_server.en.yml
|
|
414
437
|
- config/routes.rb
|
|
415
438
|
- lib/generators/qa_server/assets_generator.rb
|
|
@@ -429,13 +452,18 @@ files:
|
|
|
429
452
|
- lib/generators/qa_server/templates/config/authorities/linked_data/getty_aat_ld4l_cache.json
|
|
430
453
|
- lib/generators/qa_server/templates/config/authorities/linked_data/getty_tgn_ld4l_cache.json
|
|
431
454
|
- lib/generators/qa_server/templates/config/authorities/linked_data/getty_ulan_ld4l_cache.json
|
|
455
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/isni_ld4l_cache.json
|
|
456
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/ligatus_ld4l_cache.json
|
|
432
457
|
- lib/generators/qa_server/templates/config/authorities/linked_data/loc_direct.json
|
|
433
458
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locdemographics_ld4l_cache.json
|
|
434
459
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locgenres_ld4l_cache.json
|
|
435
460
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locnames_ld4l_cache.json
|
|
461
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo2_ld4l_cache.json
|
|
462
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo3_ld4l_cache.json
|
|
436
463
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locnames_rwo_ld4l_cache.json
|
|
437
464
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locperformance_ld4l_cache.json
|
|
438
465
|
- lib/generators/qa_server/templates/config/authorities/linked_data/locsubjects_ld4l_cache.json
|
|
466
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/locvocabs_ld4l_cache.json
|
|
439
467
|
- lib/generators/qa_server/templates/config/authorities/linked_data/mesh_nlm_ld4l_cache.json
|
|
440
468
|
- lib/generators/qa_server/templates/config/authorities/linked_data/nalt_direct.json
|
|
441
469
|
- lib/generators/qa_server/templates/config/authorities/linked_data/nalt_ld4l_cache.json
|
|
@@ -452,6 +480,8 @@ files:
|
|
|
452
480
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_aat_ld4l_cache_validation.yml
|
|
453
481
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_tgn_ld4l_cache_validation.yml
|
|
454
482
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/getty_ulan_ld4l_cache_validation.yml
|
|
483
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/isni_ld4l_cache_validation.yml
|
|
484
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/ligatus_ld4l_cache_validation.yml
|
|
455
485
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/loc_direct_validation.yml
|
|
456
486
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/loc_validation.yml
|
|
457
487
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locdemographics_ld4l_cache_validation.yml
|
|
@@ -460,6 +490,7 @@ files:
|
|
|
460
490
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locnames_rwo_ld4l_cache_validation.yml
|
|
461
491
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locperformance_ld4l_cache_validation.yml
|
|
462
492
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locsubjects_ld4l_cache_validation.yml
|
|
493
|
+
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/locvocabs_ld4l_cache_validation.yml
|
|
463
494
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/mesh_nlm_ld4l_cache_validation.yml
|
|
464
495
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/nalt_direct_validation.yml
|
|
465
496
|
- lib/generators/qa_server/templates/config/authorities/linked_data/scenarios/nalt_ld4l_cache_validation.yml
|
|
@@ -491,6 +522,8 @@ files:
|
|
|
491
522
|
- qa_server.gemspec
|
|
492
523
|
- spec/.gitignore
|
|
493
524
|
- spec/cache_processors/qa_server/cache_expiry_service_spec.rb
|
|
525
|
+
- spec/feature/accuracy_spec.rb
|
|
526
|
+
- spec/i18n_spec.rb
|
|
494
527
|
- spec/lib/configuration_spec.rb
|
|
495
528
|
- spec/lib/qa_server_spec.rb
|
|
496
529
|
- spec/rails_helper.rb
|
|
@@ -505,7 +538,7 @@ homepage: http://github.com/LD4P/qa_server
|
|
|
505
538
|
licenses:
|
|
506
539
|
- Apache-2.0
|
|
507
540
|
metadata: {}
|
|
508
|
-
post_install_message:
|
|
541
|
+
post_install_message:
|
|
509
542
|
rdoc_options: []
|
|
510
543
|
require_paths:
|
|
511
544
|
- lib
|
|
@@ -520,14 +553,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
520
553
|
- !ruby/object:Gem::Version
|
|
521
554
|
version: '0'
|
|
522
555
|
requirements: []
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
signing_key:
|
|
556
|
+
rubygems_version: 3.0.8
|
|
557
|
+
signing_key:
|
|
526
558
|
specification_version: 4
|
|
527
559
|
summary: Authority Lookup Server
|
|
528
560
|
test_files:
|
|
529
561
|
- spec/.gitignore
|
|
530
562
|
- spec/cache_processors/qa_server/cache_expiry_service_spec.rb
|
|
563
|
+
- spec/feature/accuracy_spec.rb
|
|
564
|
+
- spec/i18n_spec.rb
|
|
531
565
|
- spec/lib/configuration_spec.rb
|
|
532
566
|
- spec/lib/qa_server_spec.rb
|
|
533
567
|
- spec/rails_helper.rb
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generate graphs for the past 30 days using cached data. Graphs are generated only if the cache has expired.
|
|
3
|
-
module QaServer
|
|
4
|
-
class PerformanceDailyGraphCache
|
|
5
|
-
class_attribute :authority_list_class, :graph_data_service, :graphing_service
|
|
6
|
-
self.authority_list_class = QaServer::AuthorityListerService
|
|
7
|
-
self.graph_data_service = QaServer::PerformanceGraphDataService
|
|
8
|
-
self.graphing_service = QaServer::PerformanceGraphingService
|
|
9
|
-
|
|
10
|
-
class << self
|
|
11
|
-
include QaServer::CacheKeys
|
|
12
|
-
include QaServer::PerformanceHistoryDataKeys
|
|
13
|
-
|
|
14
|
-
# Generates graphs for the past 30 days for :search, :fetch, and :all actions for each authority.
|
|
15
|
-
# @param force [Boolean] if true, run the tests even if the cache hasn't expired; otherwise, use cache if not expired
|
|
16
|
-
def generate_graphs(force: false)
|
|
17
|
-
return unless QaServer::CacheExpiryService.cache_expired?(key: cache_key_for_force, force: force, next_expiry: next_expiry)
|
|
18
|
-
QaServer.config.monitor_logger.debug("(QaServer::PerformanceDailyGraphCache) - GENERATING daily performance graphs (force: #{force})")
|
|
19
|
-
generate_graphs_for_authorities
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
def generate_graphs_for_authorities
|
|
25
|
-
auths = authority_list_class.authorities_list
|
|
26
|
-
generate_graphs_for_authority(authority_name: ALL_AUTH) # generates graph for all authorities
|
|
27
|
-
auths.each { |authname| generate_graphs_for_authority(authority_name: authname) }
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def generate_graphs_for_authority(authority_name:)
|
|
31
|
-
[SEARCH, FETCH, ALL_ACTIONS].each_with_object({}) do |action, hash|
|
|
32
|
-
hash[action] = generate_30_day_graph(authority_name: authority_name, action: action)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def generate_30_day_graph(authority_name:, action:)
|
|
37
|
-
# real expiration or force caught by cache_expired? So if we are here, either the cache has expired
|
|
38
|
-
# or force was requested. We still expire the cache and use ttl to catch race conditions.
|
|
39
|
-
Rails.cache.fetch(cache_key_for_authority_action(authority_name: authority_name, action: action),
|
|
40
|
-
expires_in: next_expiry, race_condition_ttl: 1.hour, force: true) do
|
|
41
|
-
data = graph_data_service.calculate_last_30_days(authority_name: authority_name, action: action)
|
|
42
|
-
graphing_service.generate_daily_graph(authority_name: authority_name, action: action, data: data)
|
|
43
|
-
data
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def cache_key_for_authority_action(authority_name:, action:)
|
|
48
|
-
"#{PERFORMANCE_GRAPH_DAILY_DATA_CACHE_KEY}--#{authority_name}--#{action}"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def cache_key_for_force
|
|
52
|
-
"#{PERFORMANCE_GRAPH_DAILY_DATA_CACHE_KEY}--force"
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def next_expiry
|
|
56
|
-
QaServer::CacheExpiryService.cache_expiry
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generate graphs for the past 24 hours using cached data. The last hour of data is always calculated and all graphs
|
|
3
|
-
# for are generated.
|
|
4
|
-
module QaServer
|
|
5
|
-
class PerformanceHourlyGraphCache
|
|
6
|
-
class_attribute :authority_list_class, :graph_data_service, :graphing_service
|
|
7
|
-
self.authority_list_class = QaServer::AuthorityListerService
|
|
8
|
-
self.graph_data_service = QaServer::PerformanceGraphDataService
|
|
9
|
-
self.graphing_service = QaServer::PerformanceGraphingService
|
|
10
|
-
|
|
11
|
-
class << self
|
|
12
|
-
include QaServer::CacheKeys
|
|
13
|
-
include QaServer::PerformanceHistoryDataKeys
|
|
14
|
-
|
|
15
|
-
# Generates graphs for the past 24 hours for :search, :fetch, and :all actions for each authority.
|
|
16
|
-
# @param force [Boolean] if true, run the tests even if the cache hasn't expired; otherwise, use cache if not expired
|
|
17
|
-
def generate_graphs(force: false)
|
|
18
|
-
QaServer.config.monitor_logger.debug("(QaServer::PerformanceHourlyGraphCache) - GENERATING hourly performance graphs (force: #{force})")
|
|
19
|
-
QaServer.config.performance_cache.write_all
|
|
20
|
-
generate_graphs_for_authorities(force: force)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
def generate_graphs_for_authorities(force:)
|
|
26
|
-
auths = authority_list_class.authorities_list
|
|
27
|
-
generate_graphs_for_authority(authority_name: ALL_AUTH, force: force) # generates graph for all authorities
|
|
28
|
-
auths.each { |authname| generate_graphs_for_authority(authority_name: authname, force: force) }
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def generate_graphs_for_authority(authority_name:, force:)
|
|
32
|
-
[SEARCH, FETCH, ALL_ACTIONS].each_with_object({}) do |action, hash|
|
|
33
|
-
hash[action] = generate_24_hour_graph(authority_name: authority_name, action: action, force: force)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def generate_24_hour_graph(authority_name:, action:, force:)
|
|
38
|
-
graph_created = false
|
|
39
|
-
data = Rails.cache.fetch(cache_key_for_authority_action(authority_name: authority_name, action: action),
|
|
40
|
-
expires_in: QaServer::TimeService.current_time.end_of_hour - QaServer::TimeService.current_time,
|
|
41
|
-
race_condition_ttl: 1.hour, force: force) do
|
|
42
|
-
data = graph_data_service.calculate_last_24_hours(authority_name: authority_name, action: action)
|
|
43
|
-
graphing_service.generate_hourly_graph(authority_name: authority_name, action: action, data: data)
|
|
44
|
-
graph_created = true
|
|
45
|
-
data
|
|
46
|
-
end
|
|
47
|
-
regen_last_hour_and_graph(authority_name: authority_name, action: action, data: data) unless graph_created
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def regen_last_hour_and_graph(authority_name:, action:, data:)
|
|
51
|
-
Rails.cache.fetch(cache_key_for_authority_action(authority_name: authority_name, action: action),
|
|
52
|
-
expires_in: QaServer::TimeService.current_time.end_of_hour - QaServer::TimeService.current_time,
|
|
53
|
-
race_condition_ttl: 1.hour, force: true) do
|
|
54
|
-
data = graph_data_service.recalculate_last_hour(authority_name: authority_name, action: action, averages: data)
|
|
55
|
-
graphing_service.generate_hourly_graph(authority_name: authority_name, action: action, data: data)
|
|
56
|
-
data
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def cache_key_for_authority_action(authority_name:, action:)
|
|
61
|
-
"#{PERFORMANCE_GRAPH_HOURLY_DATA_CACHE_KEY}--#{authority_name}--#{action}"
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# Generate graphs for the past 12 months using cached data. Graphs are generated only if the cache has expired.
|
|
3
|
-
module QaServer
|
|
4
|
-
class PerformanceMonthlyGraphCache
|
|
5
|
-
class_attribute :authority_list_class, :graph_data_service, :graphing_service
|
|
6
|
-
self.authority_list_class = QaServer::AuthorityListerService
|
|
7
|
-
self.graph_data_service = QaServer::PerformanceGraphDataService
|
|
8
|
-
self.graphing_service = QaServer::PerformanceGraphingService
|
|
9
|
-
|
|
10
|
-
class << self
|
|
11
|
-
include QaServer::CacheKeys
|
|
12
|
-
include QaServer::PerformanceHistoryDataKeys
|
|
13
|
-
|
|
14
|
-
# Generates graphs for the past 30 days for :search, :fetch, and :all actions for each authority.
|
|
15
|
-
# @param force [Boolean] if true, run the tests even if the cache hasn't expired; otherwise, use cache if not expired
|
|
16
|
-
def generate_graphs(force: false)
|
|
17
|
-
return unless QaServer::CacheExpiryService.cache_expired?(key: cache_key_for_force, force: force, next_expiry: next_expiry)
|
|
18
|
-
QaServer.config.monitor_logger.debug("(QaServer::PerformanceMonthlyGraphCache) - GENERATING monthly performance graphs (force: #{force})")
|
|
19
|
-
generate_graphs_for_authorities
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
|
|
24
|
-
def generate_graphs_for_authorities
|
|
25
|
-
auths = authority_list_class.authorities_list
|
|
26
|
-
generate_graphs_for_authority(authority_name: ALL_AUTH) # generates graph for all authorities
|
|
27
|
-
auths.each { |authname| generate_graphs_for_authority(authority_name: authname) }
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def generate_graphs_for_authority(authority_name:)
|
|
31
|
-
[SEARCH, FETCH, ALL_ACTIONS].each_with_object({}) do |action, hash|
|
|
32
|
-
hash[action] = generate_12_month_graph(authority_name: authority_name, action: action)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def generate_12_month_graph(authority_name:, action:)
|
|
37
|
-
# real expiration or force caught by cache_expired? So if we are here, either the cache has expired
|
|
38
|
-
# or force was requested. We still expire the cache and use ttl to catch race conditions.
|
|
39
|
-
Rails.cache.fetch(cache_key_for_authority_action(authority_name: authority_name, action: action),
|
|
40
|
-
expires_in: next_expiry, race_condition_ttl: 1.hour, force: true) do
|
|
41
|
-
data = graph_data_service.calculate_last_12_months(authority_name: authority_name, action: action)
|
|
42
|
-
graphing_service.generate_monthly_graph(authority_name: authority_name, action: action, data: data)
|
|
43
|
-
data
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def cache_key_for_authority_action(authority_name:, action:)
|
|
48
|
-
"#{PERFORMANCE_GRAPH_MONTHLY_DATA_CACHE_KEY}--#{authority_name}--#{action}"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def cache_key_for_force
|
|
52
|
-
"#{PERFORMANCE_GRAPH_MONTHLY_DATA_CACHE_KEY}--force"
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def next_expiry
|
|
56
|
-
QaServer::CacheExpiryService.cache_expiry
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|