Module: Appsignal::Helpers::Metrics Private

Included in:
Appsignal
Defined in:
lib/appsignal/helpers/metrics.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#add_distribution_value(key, value, tags = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



43
44
45
46
47
48
49
50
51
52
# File 'lib/appsignal/helpers/metrics.rb', line 43

def add_distribution_value(key, value, tags = {})
  Appsignal::Extension.add_distribution_value(
    key.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.logger
    .warn("Distribution value #{value} for key '#{key}' is too big")
end

#increment_counter(key, value = 1.0, tags = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



32
33
34
35
36
37
38
39
40
41
# File 'lib/appsignal/helpers/metrics.rb', line 32

def increment_counter(key, value = 1.0, tags = {})
  Appsignal::Extension.increment_counter(
    key.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.logger
    .warn("Counter value #{value} for key '#{key}' is too big")
end

#set_gauge(key, value, tags = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
15
16
# File 'lib/appsignal/helpers/metrics.rb', line 7

def set_gauge(key, value, tags = {})
  Appsignal::Extension.set_gauge(
    key.to_s,
    value.to_f,
    Appsignal::Utils::Data.generate(tags)
  )
rescue RangeError
  Appsignal.logger
    .warn("Gauge value #{value} for key '#{key}' is too big")
end

#set_host_gauge(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
# File 'lib/appsignal/helpers/metrics.rb', line 18

def set_host_gauge(key, value)
  Appsignal::Extension.set_host_gauge(key.to_s, value.to_f)
rescue RangeError
  Appsignal.logger
    .warn("Host gauge value #{value} for key '#{key}' is too big")
end

#set_process_gauge(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
29
30
# File 'lib/appsignal/helpers/metrics.rb', line 25

def set_process_gauge(key, value)
  Appsignal::Extension.set_process_gauge(key.to_s, value.to_f)
rescue RangeError
  Appsignal.logger
    .warn("Process gauge value #{value} for key '#{key}' is too big")
end