Represents the state of a Client.

Exposes information on the connections maintained by a Client at a specific time.

Constructor

new

ClientState

(Array<Host> hosts, Object<String, Number> openConnections, Object<String, Number> inFlightQueries)

Creates a new instance of ClientState.

Parameters:
Name Type Description
hosts Array<Host>
openConnections Object<String, Number>
inFlightQueries Object<String, Number>

Methods

getConnectedHosts

()

Get an array of hosts to which the client is connected to.

Returns:
Type Description
Array<Host>

getInFlightQueries

(Host host)

Gets the amount of queries that are currently being executed through a given host.

This corresponds to the number of queries that have been sent by the Client to server Host on one of its connections but haven’t yet obtained a response.

Parameters:
Name Type Description
host Host
Returns:
Type Description
Number

getOpenConnections

(Host host)

Gets the amount of open connections to a given host.

Parameters:
Name Type Description
host Host
Returns:
Type Description
Number

toString

()

Returns the string representation of the instance.