Method: Couchbase::Cluster#ping

Defined in:
lib/couchbase/cluster.rb

#ping(options = Options::Ping::DEFAULT) ⇒ PingResult

Performs application-level ping requests against services in the couchbase cluster

Parameters:

Returns:



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/couchbase/cluster.rb', line 276

def ping(options = Options::Ping::DEFAULT)
  resp = @backend.ping(nil, options.to_backend)
  PingResult.new do |res|
    res.version = resp[:version]
    res.id = resp[:id]
    res.sdk = resp[:sdk]
    resp[:services].each do |type, svcs|
      res.services[type] = svcs.map do |svc|
        PingResult::ServiceInfo.new do |info|
          info.id = svc[:id]
          info.state = svc[:state]
          info.latency = svc[:latency]
          info.remote = svc[:remote]
          info.local = svc[:local]
          info.error = svc[:error]
        end
      end
    end
  end
end