Class: Speedshop::Cloudwatch::Yabeda

Inherits:
Yabeda::BaseAdapter
  • Object
show all
Defined in:
lib/speedshop/cloudwatch/yabeda.rb

Defined Under Namespace

Classes: Collector

Constant Summary collapse

UNIT_MAP =
{
  seconds: "Seconds",
  milliseconds: "Milliseconds",
  microseconds: "Microseconds",
  bytes: "Bytes",
  kilobytes: "Kilobytes",
  megabytes: "Megabytes",
  gigabytes: "Gigabytes",
  terabytes: "Terabytes",
  bits: "Bits",
  kilobits: "Kilobits",
  megabits: "Megabits",
  gigabits: "Gigabits",
  terabits: "Terabits",
  percent: "Percent",
  count: "Count"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(namespace_formatter: nil, metric_name_formatter: nil, dimension_name_formatter: nil, allowlist: nil) ⇒ Yabeda

Returns a new instance of Yabeda.



36
37
38
39
40
41
42
43
44
45
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 36

def initialize(namespace_formatter: nil, metric_name_formatter: nil, dimension_name_formatter: nil, allowlist: nil)
  @namespace_formatter = namespace_formatter
  @metric_name_formatter = metric_name_formatter
  @dimension_name_formatter = dimension_name_formatter
  @allowlist = normalize_allowlist(allowlist)

  Speedshop::Cloudwatch.configure do |config|
    config.collectors << :yabeda unless config.collectors.include?(:yabeda)
  end
end

Instance Method Details

#perform_counter_increment!(counter, tags, increment) ⇒ Object



61
62
63
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 61

def perform_counter_increment!(counter, tags, increment)
  enqueue_metric(counter, tags, increment)
end

#perform_gauge_set!(gauge, tags, value) ⇒ Object



65
66
67
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 65

def perform_gauge_set!(gauge, tags, value)
  enqueue_metric(gauge, tags, value)
end

#perform_histogram_measure!(histogram, tags, value) ⇒ Object



69
70
71
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 69

def perform_histogram_measure!(histogram, tags, value)
  enqueue_metric(histogram, tags, value)
end

#perform_summary_observe!(summary, tags, value) ⇒ Object



73
74
75
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 73

def perform_summary_observe!(summary, tags, value)
  enqueue_metric(summary, tags, value)
end

#register_counter!(_metric) ⇒ Object

CloudWatch doesn’t require pre-registration of metrics, but Yabeda’s adapter interface expects these hooks to exist for backends that do.



49
50
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 49

def register_counter!(_metric)
end

#register_gauge!(_metric) ⇒ Object



52
53
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 52

def register_gauge!(_metric)
end

#register_histogram!(_metric) ⇒ Object



55
56
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 55

def register_histogram!(_metric)
end

#register_summary!(_metric) ⇒ Object



58
59
# File 'lib/speedshop/cloudwatch/yabeda.rb', line 58

def register_summary!(_metric)
end