Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jul 10, 2024
1 parent 2e3e798 commit 78f8b78
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions lib/datadog/tracing/span_event.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
# frozen_string_literal: true

require 'time'

# frozen_string_literal: true

module Datadog
module Tracing
# SpanEvent represents an annotation on a span.
# @public_api
class SpanEvent
# @!attribute [r] name
# @return [Integer]
attr_reader :name

# @!attribute [r] attributes
# @return [Hash<String,String>]
attr_reader :attributes

# @!attribute [r] time_unix_nano
# @return [Integer]
attr_reader :time_unix_nano

def initialize(
name,
attributes: nil,
time_unix_nano: nil
)
@name = name
@attributes = attributes&.map{|key, val| [key, val.to_s]}&.to_h || {}
@time_unix_nano = time_unix_nano || Core::Utils::Time.now.to_f * 1e9
end
module Tracing
# SpanEvent represents an annotation on a span.
# @public_api
class SpanEvent
# @!attribute [r] name
# @return [Integer]
attr_reader :name

# @!attribute [r] attributes
# @return [Hash<String,String>]
attr_reader :attributes

# @!attribute [r] time_unix_nano
# @return [Integer]
attr_reader :time_unix_nano

def initialize(
name,
attributes: nil,
time_unix_nano: nil
)
@name = name
@attributes = attributes&.map { |key, val| [key, val.to_s] }&.to_h || {}
@time_unix_nano = time_unix_nano || Core::Utils::Time.now.to_f * 1e9
end
end
end
end

0 comments on commit 78f8b78

Please sign in to comment.