Module: HubStep

Defined in:
lib/hubstep.rb,
lib/hubstep/tracer.rb,
lib/hubstep/version.rb,
lib/hubstep/instrumenter.rb,
lib/hubstep/rack/middleware.rb,
lib/hubstep/faraday/middleware.rb,
lib/hubstep/transport/http_json.rb,
lib/hubstep/internal/instrumenter/noop.rb,
lib/hubstep/internal/instrumenter/memory.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Faraday, Internal, Rack, Transport Classes: Instrumenter, Tracer

Constant Summary collapse

VERSION =
"2.0.5"

Class Method Summary collapse

Class Method Details

.hostnameObject

Internal: Get this machine’s hostname.

Returns a String.



14
15
16
# File 'lib/hubstep.rb', line 14

def self.hostname
  @hostname ||= Socket.gethostname.freeze
end

.instrumenter(instrumenter: nil) ⇒ Object

getter for the instrumenter ivar. When the ivar isn’t set it will default to the Noop instrumenter

instrumenter - an object that responds to the ActiveSupport::Notifications

interface, when omitted the Noop instrumenter will be used


46
47
48
# File 'lib/hubstep.rb', line 46

def self.instrumenter(instrumenter: nil)
  @instrumenter ||= (instrumenter || HubStep::Internal::Instrumenter::Noop.new)
end

.instrumenter=(instrumenter) ⇒ Object

setter for instrumenter that defaults to the Noop instrumenter

instrumenter - an object that responds to the ActiveSupport::Notifications

interface, when omitted the Noop instrumenter will be used


36
37
38
# File 'lib/hubstep.rb', line 36

def self.instrumenter=(instrumenter)
  @instrumenter = instrumenter
end

.server_metadataObject

Internal: Reads server data written during provisioning.

Returns a Hash.



21
22
23
24
25
26
27
28
29
# File 'lib/hubstep.rb', line 21

def self.
  return  if defined?()
   =
    begin
      JSON.parse(File.read("/etc/github/metadata.json")).freeze
    rescue
      {}.freeze
    end
end