Package com.couchbase.client.core.utils
Class HealthPinger
java.lang.Object
com.couchbase.client.core.utils.HealthPinger
The
HealthPinger
allows to "ping" individual services with
real operations for their health.
This can be used by up the stack code to assert the given state of
a connected cluster and/or bucket.- Since:
- 1.5.4
- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic rx.Single<PingReport>
ping
(CoreEnvironment env, String bucket, String password, String username, ClusterFacade core, String id, long timeout, TimeUnit timeUnit, ServiceType... types) Performs a service ping against all or (if given) the services provided.
-
Constructor Details
-
HealthPinger
public HealthPinger()
-
-
Method Details
-
ping
public static rx.Single<PingReport> ping(CoreEnvironment env, String bucket, String password, String username, ClusterFacade core, String id, long timeout, TimeUnit timeUnit, ServiceType... types) Performs a service ping against all or (if given) the services provided. First, all the services are contacted with: - KV - NOOP - N1QL - GET /admin/ping (expect 200 OK) - CBFT - GET /api/ping (expect 200 OK) - Views - GET / (expect 200 OK) - Analytics - POST /query/service with data {"statement": select 1;"} (expect 200 OK) Afterwards, the responses are assembled into aPingReport
and returned.- Parameters:
env
- the environment to use.bucket
- the bucket namepassword
- the password of the bucketcore
- the core instance against to check.username
- the username (if present used), might be null.id
- the id of the ping to use, can be null.timeout
- the timeout for each individual and total ping report.timeUnit
- the time unit for the timeout value.types
- if present, limits the queried services for the given types.- Returns:
- a PingReport once the Single completes asynchronously.
-