Class: Couchbase::Cluster::DiagnosticsResult::ServiceInfo
- Inherits:
-
Object
- Object
- Couchbase::Cluster::DiagnosticsResult::ServiceInfo
- Defined in:
- lib/couchbase/cluster.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/cluster.rb more...
Instance Attribute Summary collapse
-
#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.
367 368 369 |
# File 'lib/couchbase/cluster.rb', line 367 def initialize yield self if block_given? end |
Instance Attribute Details
#id ⇒ String
Returns endpoint unique identifier.
345 346 347 |
# File 'lib/couchbase/cluster.rb', line 345 def id @id end |
#last_activity_us ⇒ Integer
Returns how long ago the endpoint was active (in microseconds).
358 359 360 |
# File 'lib/couchbase/cluster.rb', line 358 def last_activity_us @last_activity_us end |
#local ⇒ String
Returns local address of the connection.
364 365 366 |
# File 'lib/couchbase/cluster.rb', line 364 def local @local end |
#remote ⇒ String
Returns remote address of the connection.
361 362 363 |
# File 'lib/couchbase/cluster.rb', line 361 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)
355 356 357 |
# File 'lib/couchbase/cluster.rb', line 355 def state @state end |
Instance Method Details
#to_json(*args) ⇒ Object
[View source]
371 372 373 374 375 376 377 378 379 380 |
# File 'lib/couchbase/cluster.rb', line 371 def to_json(*args) data = { id: @id, state: @state, remote: @remote, local: @local, } data[:last_activity_us] = @last_activity_us if defined? @last_activity_us data.to_json(*args) end |