Class: Couchbase::Options::Ping

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

Overview

Options for Bucket#ping

Constant Summary collapse

DEFAULT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Ping.new.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_id: nil, service_types: [:kv, :query, :analytics, :search, :views, :management], timeout: nil, parent_span: nil) {|self| ... } ⇒ Ping

Creates an instance of options for Bucket#ping

Parameters:

  • report_id (String) (defaults to: nil)

    Holds custom report id.

  • service_types (Array<Symbol>) (defaults to: [:kv, :query, :analytics, :search, :views, :management])

    The service types to limit this ping request

  • timeout (Integer, #in_milliseconds) (defaults to: nil)
  • parent_span (Span, nil) (defaults to: nil)

    if set holds the parent span, that should be used for this request

Yield Parameters:



1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
# File 'lib/couchbase/options.rb', line 1932

def initialize(report_id: nil,
               service_types: [:kv, :query, :analytics, :search, :views, :management],
               timeout: nil,
               parent_span: nil)
  @report_id = report_id
  @service_types = service_types
  @timeout = timeout
  @parent_span = parent_span

  yield self if block_given?
end

Instance Attribute Details

#parent_spanSpan?

Returns:

  • (Span, nil)


1922
1923
1924
# File 'lib/couchbase/options.rb', line 1922

def parent_span
  @parent_span
end

#report_idString

Returns:

  • (String)


1919
1920
1921
# File 'lib/couchbase/options.rb', line 1919

def report_id
  @report_id
end

#service_typesArray<Symbol>

Returns:

  • (Array<Symbol>)


1920
1921
1922
# File 'lib/couchbase/options.rb', line 1920

def service_types
  @service_types
end

#timeoutInteger, #in_milliseconds

Returns:

  • (Integer, #in_milliseconds)


1921
1922
1923
# File 'lib/couchbase/options.rb', line 1921

def timeout
  @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.



1945
1946
1947
1948
1949
1950
1951
# File 'lib/couchbase/options.rb', line 1945

def to_backend
  {
    timeout: Utils::Time.extract_duration(@timeout),
    service_types: @service_types,
    report_id: @report_id,
  }
end