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.



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

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



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

def hits
  @hits
end

#samplesObject

Returns the value of attribute samples



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

def samples
  @samples
end

#schemaObject

Returns the value of attribute schema



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

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.



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

def increment(request)
  self.hits += 1

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