module ScoutApm::BucketNameSplitter

Public Instance Methods

bucket_name() click to toggle source
# File lib/scout_apm/bucket_name_splitter.rb, line 7
def bucket_name
  split_metric_name(metric_name).last
end
bucket_type() click to toggle source
# File lib/scout_apm/bucket_name_splitter.rb, line 3
def bucket_type
  split_metric_name(metric_name).first
end
key() click to toggle source
# File lib/scout_apm/bucket_name_splitter.rb, line 11
def key
  {:bucket => bucket_type, :name => bucket_name}
end

Private Instance Methods

scope_hash() click to toggle source
# File lib/scout_apm/bucket_name_splitter.rb, line 20
def scope_hash
  if scope
    scope_bucket, scope_name = split_metric_name(scope)
    {:bucket => scope_bucket, :name => scope_name}
  end
end
split_metric_name(metric_name) click to toggle source
# File lib/scout_apm/bucket_name_splitter.rb, line 16
def split_metric_name(metric_name)
  metric_name.to_s.split(/\//, 2)
end