Module: Datadog::CI::TestOptimisation::Telemetry

Defined in:
lib/datadog/ci/test_optimisation/telemetry.rb

Overview

Telemetry for test optimisation component

Class Method Summary collapse

Class Method Details

.code_coverage_files(count) ⇒ Object



25
26
27
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 25

def self.code_coverage_files(count)
  Utils::Telemetry.distribution(Ext::Telemetry::METRIC_CODE_COVERAGE_FILES, count.to_f)
end

.code_coverage_finished(test) ⇒ Object



17
18
19
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 17

def self.code_coverage_finished(test)
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_FINISHED, 1, tags_for_test(test))
end

.code_coverage_is_emptyObject



21
22
23
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 21

def self.code_coverage_is_empty
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_IS_EMPTY, 1)
end

.code_coverage_started(test) ⇒ Object



13
14
15
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 13

def self.code_coverage_started(test)
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_STARTED, 1, tags_for_test(test))
end

.itr_forced_runObject



33
34
35
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 33

def self.itr_forced_run
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_ITR_FORCED_RUN, 1, tags_for_itr_metrics)
end

.itr_skippedObject



29
30
31
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 29

def self.itr_skipped
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_ITR_SKIPPED, 1, tags_for_itr_metrics)
end

.itr_unskippableObject



37
38
39
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 37

def self.itr_unskippable
  Utils::Telemetry.inc(Ext::Telemetry::METRIC_ITR_UNSKIPPABLE, 1, tags_for_itr_metrics)
end

.tags_for_itr_metricsObject



48
49
50
51
52
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 48

def self.tags_for_itr_metrics
  {
    Ext::Telemetry::TAG_EVENT_TYPE => Ext::Telemetry::EventType::TEST
  }
end

.tags_for_test(test) ⇒ Object



41
42
43
44
45
46
# File 'lib/datadog/ci/test_optimisation/telemetry.rb', line 41

def self.tags_for_test(test)
  {
    Ext::Telemetry::TAG_TEST_FRAMEWORK => test.get_tag(Ext::Test::TAG_FRAMEWORK),
    Ext::Telemetry::TAG_LIBRARY => Ext::Telemetry::Library::CUSTOM
  }
end