Sha256: 7d2513c79c9e15a295183015a4d9280c49819227f5c293566bfe1f671ed419d0

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

require 'sqreen/kit/configuration'
require 'sqreen/kit/signals/point'
require 'sqreen/kit/signals/dto_helper'

# reference: https://github.com/sqreen/SignalsSchemas/blob/master/schemas/payload/tracing/client-2020-04-21/schema.cue

module Sqreen
  module Ecosystem
    module Tracing
      module Signals
      end
    end
  end
end

class Sqreen::Ecosystem::Tracing::Signals::TracingClient < Sqreen::Kit::Signals::Point
  readonly_attrs :payload_schema, :source, :signal_name

  def initialize(values = {})
    self.payload_schema = Payload::SCHEMA_VERSION
    self.source = Sqreen::Kit::Configuration.default_source
    self.signal_name = 'tracing.client'
    self.time = values[:time] || Time.now
    super
  end

  def payload=(payload)
    unless payload.is_a?(Payload)
      raise ArgumentError, "Payload should be a #{Payload}"
    end
    super
  end

  class Payload
    include Sqreen::Kit::Signals::DtoHelper

    add_mandatory_attrs :transport, :host

    SCHEMA_VERSION = 'tracing/client-2020-04-21'.freeze

    # @return [Symbol]
    attr_accessor :transport

    # @return [String]
    attr_accessor :host

    # @return [String]
    attr_accessor :ip

    # @return [String]
    attr_accessor :tracing_identifier
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sqreen-1.22.0-java lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.22.0 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.1-java lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.1 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0-java lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0.beta3-java lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0.beta3 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0.beta2 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb
sqreen-1.21.0.beta1 lib/sqreen/ecosystem/tracing/signals/tracing_client.rb