Class: Couchbase::DiagnosticsResult::ServiceInfo
- Inherits:
-
Object
- Object
- Couchbase::DiagnosticsResult::ServiceInfo
- Defined in:
- lib/couchbase/diagnostics.rb,
/code/couchbase-ruby-client/lib/couchbase/diagnostics.rb
Instance Attribute Summary collapse
-
#details ⇒ String?
Optional string with additional explanation for the state.
-
#id ⇒ String
Endpoint unique identifier.
-
#last_activity_us ⇒ Integer
How long ago the endpoint was active (in microseconds).
-
#local ⇒ String
Local address of the connection.
-
#remote ⇒ String
Remote address of the connection.
-
#state ⇒ Symbol
Possible states are:.
Instance Method Summary collapse
-
#initialize {|self| ... } ⇒ ServiceInfo
constructor
A new instance of ServiceInfo.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize {|self| ... } ⇒ ServiceInfo
Returns a new instance of ServiceInfo.
46 47 48 |
# File 'lib/couchbase/diagnostics.rb', line 46 def initialize yield self if block_given? end |
Instance Attribute Details
#details ⇒ String?
Returns optional string with additional explanation for the state.
34 35 36 |
# File 'lib/couchbase/diagnostics.rb', line 34 def details @details end |
#id ⇒ String
Returns endpoint unique identifier.
21 22 23 |
# File 'lib/couchbase/diagnostics.rb', line 21 def id @id end |
#last_activity_us ⇒ Integer
Returns how long ago the endpoint was active (in microseconds).
37 38 39 |
# File 'lib/couchbase/diagnostics.rb', line 37 def last_activity_us @last_activity_us end |
#local ⇒ String
Returns local address of the connection.
43 44 45 |
# File 'lib/couchbase/diagnostics.rb', line 43 def local @local end |
#remote ⇒ String
Returns remote address of the connection.
40 41 42 |
# File 'lib/couchbase/diagnostics.rb', line 40 def remote @remote end |
#state ⇒ Symbol
Possible states are:
- :disconnected
-
the endpoint is not reachable
- :connecting
-
currently connecting (includes auth, handshake, etc.)
- :connected
-
connected and ready
- :disconnecting
-
disconnecting (after being connected)
31 32 33 |
# File 'lib/couchbase/diagnostics.rb', line 31 def state @state end |
Instance Method Details
#to_json(*args) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/couchbase/diagnostics.rb', line 50 def to_json(*args) data = { id: @id, state: @state, remote: @remote, local: @local, } data[:details] = @details if @details data[:last_activity_us] = @last_activity_us if @last_activity_us data.to_json(*args) end |