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.



45
46
47
48
# File 'lib/aikido/zen/collector/routes.rb', line 45

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



44
45
46
# File 'lib/aikido/zen/collector/routes.rb', line 44

def hits
  @hits
end

#samplesObject

Returns the value of attribute samples

Returns:

  • (Object)

    the current value of samples



44
45
46
# File 'lib/aikido/zen/collector/routes.rb', line 44

def samples
  @samples
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



44
45
46
# File 'lib/aikido/zen/collector/routes.rb', line 44

def schema
  @schema
end

Instance Method Details

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



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

def increment(request)
  self.hits += 1

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