Skip to content

Commit

Permalink
update the doc for aggregation_temporality
Browse files Browse the repository at this point in the history
  • Loading branch information
xuan-cao-swi committed Nov 27, 2024
1 parent 5b73728 commit 2343b88
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,23 @@ module OpenTelemetry
module SDK
module Metrics
module Aggregation
# Status represents the status of a finished {Span}. It is composed of a
# status code in conjunction with an optional descriptive message.
# AggregationTemporality represents the temporality of
# data point ({NumberDataPoint} and {HistogramDataPoint}) in {Metrics}.
# It determine whether the data point will be cleared for each metrics pull/export.
class AggregationTemporality
class << self
private :new

# Returns a newly created {Status} with code == UNSET and an optional
# description.
# Returns a newly created {AggregationTemporality} with temporality == DELTA
#
# @param [String] description
# @return [Status]
# @return [AggregationTemporality]
def delta
new(DELTA)
end

# Returns a newly created {Status} with code == OK and an optional
# description.
# Returns a newly created {AggregationTemporality} with temporality == CUMULATIVE
#
# @param [String] description
# @return [Status]
# @return [AggregationTemporality]
def cumulative
new(CUMULATIVE)
end
Expand All @@ -37,11 +34,10 @@ def cumulative

# @api private
# The constructor is private and only for use internally by the class.
# Users should use the {unset}, {error}, or {ok} factory methods to
# obtain a {Status} instance.
# Users should use the {delta} and {cumulative} factory methods to obtain
# a {AggregationTemporality} instance.
#
# @param [Integer] code One of the status codes below
# @param [String] description
# @param [Integer] temporality One of the status codes below
def initialize(temporality)
@temporality = temporality
end
Expand All @@ -54,13 +50,10 @@ def cumulative?
@temporality == :cumulative
end

# The following represents the set of status codes of a
# finished {Span}

# The operation completed successfully.
# delta: data point will be cleared after each metrics pull/export.
DELTA = :delta

# The default status.
# cumulative: data point will NOT be cleared after metrics pull/export.
CUMULATIVE = :cumulative
end
end
Expand Down

0 comments on commit 2343b88

Please sign in to comment.