qa_server 5.0.3 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/prepends/prepended_linked_data/find_term.rb +7 -1
- data/app/prepends/prepended_linked_data/search_query.rb +4 -0
- data/app/prepends/prepended_rdf/rdf_graph.rb +2 -0
- data/lib/generators/qa_server/templates/config/initializers/qa_server.rb +5 -0
- data/lib/qa_server/configuration.rb +8 -0
- data/lib/qa_server/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91196c2e5b8c6f31cb7c3e38e6fd7567cae793f8
|
4
|
+
data.tar.gz: 3fa8f94c8f584a7e9110d5a046bc5abf234e9f28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46dd223510421a7a72f1c1f507ea2e33b2dd1064595fafd783b17f9f555056cb44b5f6e744afd1b08dcbbbabe77fa309e73f5e7fe4d1c84280efa69dc443b45a
|
7
|
+
data.tar.gz: bcecafa888be4eeaf4dc6bfb44acd6b4b70b4b239e8de64b12138945e6c8930b268ad40487d14da36d8e8ab7a7779df2f472c9c1e70efbf659ca5c7d3d17efc9
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,8 @@ module PrependedLinkedData::FindTerm
|
|
3
3
|
# Override Qa::Authorities::LinkedData::FindTerm#find method
|
4
4
|
# @return [Hash] single term results in requested format
|
5
5
|
def find(id, request_header: {}, language: nil, replacements: {}, subauth: nil, format: nil, performance_data: false) # rubocop:disable Metrics/ParameterLists
|
6
|
+
return super if QaServer.config.suppress_performance_gathering
|
7
|
+
|
6
8
|
start_time_s = Time.now.to_f
|
7
9
|
request_header = build_request_header(language: language, replacements: replacements, subauth: subauth, format: format, performance_data: performance_data) if request_header.empty?
|
8
10
|
saved_performance_data = performance_data || request_header[:performance_data]
|
@@ -33,6 +35,8 @@ module PrependedLinkedData::FindTerm
|
|
33
35
|
|
34
36
|
# Override to append performance history record id into the URL to allow access to the record in RDF::Graph
|
35
37
|
def load_graph(url:)
|
38
|
+
return super if QaServer.config.suppress_performance_gathering
|
39
|
+
|
36
40
|
access_start_dt = Time.now.utc
|
37
41
|
|
38
42
|
url += "&phid=#{@phid}"
|
@@ -44,8 +48,10 @@ module PrependedLinkedData::FindTerm
|
|
44
48
|
Rails.logger.info("Time to receive data from authority: #{access_time_s}s")
|
45
49
|
end
|
46
50
|
|
47
|
-
# Temporary override to fix bug. Remove when QA
|
51
|
+
# Temporary override to fix bug. Remove when QA Issue #271 is fixed and a new release is cut
|
48
52
|
def performance_data?
|
53
|
+
return super if QaServer.config.suppress_performance_gathering
|
54
|
+
|
49
55
|
@performance_data == true
|
50
56
|
end
|
51
57
|
end
|
@@ -3,6 +3,8 @@ module PrependedLinkedData::SearchQuery
|
|
3
3
|
# Override Qa::Authorities::LinkedData::SearchQuery#search method
|
4
4
|
# @return [String] json results for search query
|
5
5
|
def search(query, request_header: {}, language: nil, replacements: {}, subauth: nil, context: false, performance_data: false) # rubocop:disable Metrics/ParameterLists
|
6
|
+
return super if QaServer.config.suppress_performance_gathering
|
7
|
+
|
6
8
|
start_time_s = Time.now.to_f
|
7
9
|
request_header = build_request_header(language: language, replacements: replacements, subauth: subauth, context: context, performance_data: performance_data) if request_header.empty?
|
8
10
|
saved_performance_data = performance_data || request_header[:performance_data]
|
@@ -33,6 +35,8 @@ module PrependedLinkedData::SearchQuery
|
|
33
35
|
|
34
36
|
# Override to append performance history record id into the URL to allow access to the record in RDF::Graph
|
35
37
|
def load_graph(url:)
|
38
|
+
return super if QaServer.config.suppress_performance_gathering
|
39
|
+
|
36
40
|
access_start_dt = Time.now.utc
|
37
41
|
|
38
42
|
url += "&phid=#{@phid}"
|
@@ -12,6 +12,8 @@ module PrependedRdf::RdfGraph
|
|
12
12
|
# Set set graph name of each loaded statement
|
13
13
|
# @return [void]
|
14
14
|
def load(url, graph_name: nil, **options) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
15
|
+
return super if QaServer.config.suppress_performance_gathering
|
16
|
+
|
15
17
|
raise TypeError, "#{self} is immutable" if immutable?
|
16
18
|
phid, real_url = parse_phid(url)
|
17
19
|
ph_record = QaServer::PerformanceHistory.find(phid)
|
@@ -56,4 +56,9 @@ QaServer.config do |config|
|
|
56
56
|
# config.navmenu_extra_leftitems = [
|
57
57
|
# { label: 'Your Menu Item Label', url: 'http://your.menu.item/url' }
|
58
58
|
# ]
|
59
|
+
|
60
|
+
# Performance data is gathered on every incoming query. If load is high, this can have a negative performance
|
61
|
+
# impact and may need to be suppressed. Performance stats will not be gathered when this config is true.
|
62
|
+
# @param [Boolean] do not gather performance data when true (defaults to false for backward compatibitily)
|
63
|
+
# config.suppress_performance_gathering = false
|
59
64
|
end
|
@@ -114,5 +114,13 @@ module QaServer
|
|
114
114
|
f.puts('action, http request, load graph, normalization, TOTAL, data size, authority')
|
115
115
|
end
|
116
116
|
end
|
117
|
+
|
118
|
+
# Performance data is gathered on every incoming query. If load is high, this can have a negative performance
|
119
|
+
# impact and may need to be suppressed. Performance stats will not be gathered when this config is true.
|
120
|
+
# @param [Boolean] do not gather performance data when true (defaults to false for backward compatibitily)
|
121
|
+
attr_writer :suppress_performance_gathering
|
122
|
+
def suppress_performance_gathering
|
123
|
+
@suppress_performance_gathering ||= false
|
124
|
+
end
|
117
125
|
end
|
118
126
|
end
|
data/lib/qa_server/version.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: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- E. Lynette Rayle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|