Sha256: df8bcbde1182e20482a2145d30b0e2efd6d405cbec7fac039f6465197b964ce6

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

module PrependedLinkedData::FindTerm
  # Override Qa::Authorities::LinkedData::FindTerm#find method
  # @return [Hash] single term results in requested format
  def find(id, language: nil, replacements: {}, subauth: nil, format: nil, jsonld: false, performance_data: false) # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
    saved_performance_data = performance_data
    performance_data = true
    full_results = super
    QaServer::PerformanceHistory.save_result(dt_stamp: Time.now,
                                             authority: authority_name,
                                             action: 'fetch',
                                             size_bytes: full_results[:performance][:fetched_bytes],
                                             load_time_ms: (full_results[:performance][:fetch_time_s] * 1000),
                                             normalization_time_ms: (full_results[:performance][:normalization_time_s] * 1000))
    saved_performance_data ? full_results : full_results[:results]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qa_server-2.2.0 app/prepends/prepended_linked_data/find_term.rb