Class: Aikido::Zen::Collector::Routes::Record Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/aikido/zen/collector/routes.rb

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

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 Record.



50
51
52
53
# File 'lib/aikido/zen/collector/routes.rb', line 50

def initialize(config = Aikido::Zen.config)
  super(0, Aikido::Zen::Request::Schema::EMPTY_SCHEMA, 0)
  @config = config
end

Instance Attribute Details

#hitsObject

Returns the value of attribute hits

Returns:

  • (Object)

    the current value of hits



49
50
51
# File 'lib/aikido/zen/collector/routes.rb', line 49

def hits
  @hits
end

#samplesObject

Returns the value of attribute samples

Returns:

  • (Object)

    the current value of samples



49
50
51
# File 'lib/aikido/zen/collector/routes.rb', line 49

def samples
  @samples
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



49
50
51
# File 'lib/aikido/zen/collector/routes.rb', line 49

def schema
  @schema
end

Instance Method Details

#increment(schema) ⇒ 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.



55
56
57
58
59
60
61
62
# File 'lib/aikido/zen/collector/routes.rb', line 55

def increment(schema)
  self.hits += 1

  if sample_schema?
    self.samples += 1
    self.schema |= schema
  end
end