Class: Couchbase::Options::Cluster::ApplicationTelemetry

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/options.rb

Overview

Application Telemetry Options for Cluster.connect. Part of Couchbase::Options::Cluster

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, override_endpoint: nil, backoff: nil, ping_interval: nil, ping_timeout: nil) {|_self| ... } ⇒ ApplicationTelemetry

Creates an instance of app telemetry options for Cluster.connect. Part of Couchbase::Options::Cluster.

Parameters:

  • enable (nil, Boolean) (defaults to: nil)

    whether to enable application telemetry capture. Application telemetry is enabled by default.

  • override_endpoint (nil, String) (defaults to: nil)

    overrides the default endpoint used for application service telemetry The endpoint must use the WebSocket protocol and the string should start with ws://.

  • backoff (nil, Integer, #in_milliseconds) (defaults to: nil)

    specifies the duration to wait between connection attempts to an application telemetry endpoint

  • ping_interval (nil, Integer, #in_milliseconds) (defaults to: nil)

    specifies how often the SDK should ping the application service telemetry collector

  • ping_timeout (nil, Integer, #in_milliseconds) (defaults to: nil)

    specifies how long the SDK should wait for a ping response (pong) from the application service collector, before closing the connection and attempting to reconnect

Yields:

  • (_self)

Yield Parameters:



1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/couchbase/options.rb', line 1872

def initialize(enable: nil,
               override_endpoint: nil,
               backoff: nil,
               ping_interval: nil,
               ping_timeout: nil)
  @enable = enable
  @override_endpoint = override_endpoint
  @backoff = backoff
  @ping_interval = ping_interval
  @ping_timeout = ping_timeout

  yield self if block_given?
end

Instance Attribute Details

#backoffnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)


1855
1856
1857
# File 'lib/couchbase/options.rb', line 1855

def backoff
  @backoff
end

#enablenil, Boolean

Returns:

  • (nil, Boolean)


1853
1854
1855
# File 'lib/couchbase/options.rb', line 1853

def enable
  @enable
end

#override_endpointnil, String

Returns:

  • (nil, String)


1854
1855
1856
# File 'lib/couchbase/options.rb', line 1854

def override_endpoint
  @override_endpoint
end

#ping_intervalnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)


1856
1857
1858
# File 'lib/couchbase/options.rb', line 1856

def ping_interval
  @ping_interval
end

#ping_timeoutnil, ...

Returns:

  • (nil, Integer, #in_milliseconds)


1857
1858
1859
# File 'lib/couchbase/options.rb', line 1857

def ping_timeout
  @ping_timeout
end

Instance Method Details

#to_backendObject

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.



1887
1888
1889
1890
1891
1892
1893
1894
1895
# File 'lib/couchbase/options.rb', line 1887

def to_backend
  {
    enable: @enable,
    override_endpoint: @override_endpoint,
    backoff: Utils::Time.extract_duration(@backoff),
    ping_interval: Utils::Time.extract_duration(@ping_interval),
    ping_timeout: Utils::Time.extract_duration(@ping_timeout),
  }
end