diff options
| author | Rémy Coutable <remy@rymai.me> | 2016-04-13 10:02:30 +0000 |
|---|---|---|
| committer | Rémy Coutable <remy@rymai.me> | 2016-04-13 10:02:30 +0000 |
| commit | bbf49ffca1c1be65567afa76961d176e57d40150 (patch) | |
| tree | b373e267de36e005d5b972a54175722104c18ab8 /lib | |
| parent | e83424a13e1b5d2e55ae5bd0aeae6a4c5f88262a (diff) | |
| parent | 3240ecfbefc7ae5994be6ef01b52c1cbdaa09057 (diff) | |
| download | gitlab-ce-bbf49ffca1c1be65567afa76961d176e57d40150.tar.gz | |
Merge branch 'custom-transaction-tags' into 'master'
Added ability to add custom tags to transactions
cc @pcarranza
See merge request !3674
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/metrics.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index 2a0a5629be5..484970c5a10 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -104,6 +104,16 @@ module Gitlab retval end + # Adds a tag to the current transaction (if any) + # + # name - The name of the tag to add. + # value - The value of the tag. + def self.tag_transaction(name, value) + trans = current_transaction + + trans.add_tag(name, value) if trans + end + # When enabled this should be set before being used as the usual pattern # "@foo ||= bar" is _not_ thread-safe. if enabled? |
