Module: Coolhand::Collector

Defined in:
lib/coolhand/collector.rb

Overview

Utility for generating collector identification string

Constant Summary collapse

COLLECTION_METHODS =
%w[manual auto-monitor].freeze

Class Method Summary collapse

Class Method Details

.get_collector_string(method = nil) ⇒ String

Gets the collector identification string Format: “coolhand-ruby-X.Y.Z” or “coolhand-ruby-X.Y.Z-method”

Parameters:

  • method (String, nil) (defaults to: nil)

    Optional collection method suffix

Returns:

  • (String)

    Collector string identifying this SDK version and collection method



13
14
15
16
# File 'lib/coolhand/collector.rb', line 13

def get_collector_string(method = nil)
  base = "coolhand-ruby-#{VERSION}"
  method && COLLECTION_METHODS.include?(method) ? "#{base}-#{method}" : base
end