class Atatus::Collector::Layer

Constants

KINDS
TYPES

Attributes

count[R]
id[RW]
kind[R]
max[R]
min[R]
pid[RW]
total[R]
type[R]

Public Class Methods

new(type, kind, duration) click to toggle source
# File lib/atatus/collector/layer.rb, line 5
def initialize(type, kind, duration)
  @type = type
  @kind = kind
  @count = 1
  @min = duration
  @max = duration
  @total = duration
end
span_kind(value) click to toggle source
# File lib/atatus/collector/layer.rb, line 24
def self.span_kind(value)
  return KINDS.fetch(value, value)
end
span_type(value) click to toggle source
# File lib/atatus/collector/layer.rb, line 28
def self.span_type(value)
  return TYPES.fetch(value, value)
end

Public Instance Methods

aggregate!(duration) click to toggle source
# File lib/atatus/collector/layer.rb, line 17
def aggregate!(duration)
  @count += 1
  @min = duration if duration < @min
  @max = duration if duration > @max
  @total += duration
end