Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/artifacts/metrics.rb')
-rw-r--r--lib/gitlab/ci/artifacts/metrics.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/gitlab/ci/artifacts/metrics.rb b/lib/gitlab/ci/artifacts/metrics.rb
index 656f4d2cc13..03459c4bf36 100644
--- a/lib/gitlab/ci/artifacts/metrics.rb
+++ b/lib/gitlab/ci/artifacts/metrics.rb
@@ -6,10 +6,14 @@ module Gitlab
class Metrics
include Gitlab::Utils::StrongMemoize
- def increment_destroyed_artifacts(size)
+ def increment_destroyed_artifacts_count(size)
destroyed_artifacts_counter.increment({}, size.to_i)
end
+ def increment_destroyed_artifacts_bytes(bytes)
+ destroyed_artifacts_bytes_counter.increment({}, bytes)
+ end
+
private
def destroyed_artifacts_counter
@@ -20,6 +24,15 @@ module Gitlab
::Gitlab::Metrics.counter(name, comment)
end
end
+
+ def destroyed_artifacts_bytes_counter
+ strong_memoize(:destroyed_artifacts_bytes_counter) do
+ name = :destroyed_job_artifacts_bytes_total
+ comment = 'Counter of bytes of destroyed expired job artifacts'
+
+ ::Gitlab::Metrics.counter(name, comment)
+ end
+ end
end
end
end