Class: Qa::LinkedData::PerformanceDataService

Inherits:
Object
  • Object
show all
Defined in:
app/services/qa/linked_data/performance_data_service.rb

Class Method Summary collapse

Class Method Details

.performance_data(access_time_s:, normalize_time_s:, fetched_data_graph:, normalized_data:) ⇒ Object

Construct performance data structure to include in the returned results (linked data module).

Parameters:

  • access_time_s (Float)

    time to fetch the data from the external source and populate it in an RDF graph

  • normalization_time_s (Float)

    time for QA to normalize the data

  • fetched_size (Float)

    size of data in the RDF graph (in bytes)

  • normalized_size (Float)

    size of the normalized data string (in bytes)

See Also:



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/qa/linked_data/performance_data_service.rb', line 13

def self.performance_data(access_time_s:, normalize_time_s:, fetched_data_graph:, normalized_data:)
  normalized_size = normalized_data.to_s.size
  fetched_size = fetched_data_graph.triples.to_s.size
  {
    fetch_time_s: access_time_s,
    normalization_time_s: normalize_time_s,
    fetched_bytes: fetched_size,
    normalized_bytes: normalized_size,
    fetch_bytes_per_s: fetched_size / access_time_s,
    normalization_bytes_per_s: normalized_size / normalize_time_s,
    total_time_s: (access_time_s + normalize_time_s)
  }
end