Class: Gitlab::RSpecMetricsExporter::TestMetrics

Inherits:
Object
  • Object
show all
Includes:
Pipeline
Defined in:
lib/gitlab/rspec_metrics_exporter/test_metrics.rb

Constant Summary

Constants included from Pipeline

Pipeline::STABLE_EE_BRANCH_REGEX

Instance Method Summary collapse

Methods included from Pipeline

#ci_pipeline_id, #pipeline_type

Methods included from Env

#env_fetch, #env_parse_int_or_nil, #env_present?

Constructor Details

#initialize(example, timestamp) ⇒ TestMetrics

Returns a new instance of TestMetrics.



15
16
17
18
# File 'lib/gitlab/rspec_metrics_exporter/test_metrics.rb', line 15

def initialize(example, timestamp)
  @example = example
  @timestamp = timestamp
end

Instance Method Details

#dataHash

Test data hash

Returns:

  • (Hash)


23
24
25
26
27
28
29
30
# File 'lib/gitlab/rspec_metrics_exporter/test_metrics.rb', line 23

def data
  {
    timestamp: timestamp,
    **rspec_metrics,
    **ci_metrics,
    **custom_metrics
  }.compact
end