Class: Atatus::Metricset Private

Inherits:
Object
  • Object
show all
Defined in:
lib/atatus/metricset.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(timestamp: Util.micros, tags: nil, transaction: nil, span: nil, **samples) ⇒ Metricset

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



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/atatus/metricset.rb', line 23

def initialize(
  timestamp: Util.micros,
  tags: nil,
  transaction: nil,
  span: nil,
  **samples
)
  @timestamp = timestamp
  @tags = tags
  @transaction = transaction
  @span = span
  @samples = samples
end

Instance Attribute Details

#samplesObject (readonly)

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.



38
39
40
# File 'lib/atatus/metricset.rb', line 38

def samples
  @samples
end

#spanObject

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.



37
38
39
# File 'lib/atatus/metricset.rb', line 37

def span
  @span
end

#tagsObject

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.



37
38
39
# File 'lib/atatus/metricset.rb', line 37

def tags
  @tags
end

#timestampObject

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.



37
38
39
# File 'lib/atatus/metricset.rb', line 37

def timestamp
  @timestamp
end

#transactionObject

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.



37
38
39
# File 'lib/atatus/metricset.rb', line 37

def transaction
  @transaction
end

Instance Method Details

#empty?Boolean

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:

  • (Boolean)


51
52
53
# File 'lib/atatus/metricset.rb', line 51

def empty?
  samples.empty?
end

#inspectObject

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
# File 'lib/atatus/metricset.rb', line 55

def inspect
  "<Atatus::Metricset timestamp:#{timestamp}" \
    " transaction:#{transaction.inspect}" \
    " span:#{span.inspect}" \
    " tags:#{tags.inspect}" \
    " samples:#{samples.inspect}>"
end

#merge_tags!(tags) ⇒ 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.



40
41
42
43
44
45
# File 'lib/atatus/metricset.rb', line 40

def merge_tags!(tags)
  return unless tags

  @tags ||= {}
  @tags.merge! tags
end

#tags?Boolean

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:

  • (Boolean)


47
48
49
# File 'lib/atatus/metricset.rb', line 47

def tags?
  tags&.any?
end