Class: Aikido::Zen::Collector::Hosts Private

Inherits:
Aikido::Zen::CappedMap show all
Defined in:
lib/aikido/zen/collector/hosts.rb

Overview

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

Keeps track of the hostnames to which the app has made outbound HTTP requests.

Instance Attribute Summary

Attributes inherited from Aikido::Zen::CappedMap

#capacity

Instance Method Summary collapse

Methods inherited from Aikido::Zen::CappedMap

#[], #[]=, #fetch

Constructor Details

#initialize(config = Aikido::Zen.config) ⇒ Hosts

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.

Returns a new instance of Hosts.



11
12
13
# File 'lib/aikido/zen/collector/hosts.rb', line 11

def initialize(config = Aikido::Zen.config)
  super(config.max_outbound_connections)
end

Instance Method Details

#add(host) ⇒ void

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.

This method returns an undefined value.

Parameters:



17
18
19
20
# File 'lib/aikido/zen/collector/hosts.rb', line 17

def add(host)
  self[host] ||= host
  self[host].hit
end

#as_jsonObject

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.



26
27
28
# File 'lib/aikido/zen/collector/hosts.rb', line 26

def as_json
  map(&:as_json)
end

#each(&blk) ⇒ 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.



22
23
24
# File 'lib/aikido/zen/collector/hosts.rb', line 22

def each(&blk)
  each_value(&blk)
end