-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from DataDog/anmarchenko/telemetry_metrics_co…
…de_coverage [SDTEST-160] Implement code coverage metrics for internal telemetry
- Loading branch information
Showing
7 changed files
with
227 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../ext/telemetry" | ||
require_relative "../ext/test" | ||
require_relative "../utils/telemetry" | ||
|
||
module Datadog | ||
module CI | ||
module TestOptimisation | ||
# Telemetry for test optimisation component | ||
module Telemetry | ||
def self.code_coverage_started(test) | ||
Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_STARTED, 1, tags_for_test(test)) | ||
end | ||
|
||
def self.code_coverage_finished(test) | ||
Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_FINISHED, 1, tags_for_test(test)) | ||
end | ||
|
||
def self.code_coverage_is_empty | ||
Utils::Telemetry.inc(Ext::Telemetry::METRIC_CODE_COVERAGE_IS_EMPTY, 1) | ||
end | ||
|
||
def self.code_coverage_files(count) | ||
Utils::Telemetry.distribution(Ext::Telemetry::METRIC_CODE_COVERAGE_FILES, count.to_f) | ||
end | ||
|
||
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 | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Datadog | ||
module CI | ||
module TestOptimisation | ||
module Telemetry | ||
def self.code_coverage_started: (Datadog::CI::Test test) -> void | ||
|
||
def self.code_coverage_finished: (Datadog::CI::Test test) -> void | ||
|
||
def self.code_coverage_is_empty: () -> void | ||
|
||
def self.code_coverage_files: (Integer count) -> void | ||
|
||
def self.tags_for_test: (Datadog::CI::Test test) -> ::Hash[String, String] | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.