Class TransportHealth.Builder
java.lang.Object
express.mvp.myra.transport.TransportHealth.Builder
- Enclosing class:
TransportHealth
Builder for constructing
TransportHealth instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactiveConnections(int count) Sets the active connection count.build()Builds the health snapshot.healthy(boolean healthy) Sets the overall health status.Records an error, which also sets healthy to false.pendingOperations(int count) Sets the pending operation count.totalBytesReceived(long bytes) Sets the total bytes received counter.totalBytesSent(long bytes) Sets the total bytes sent counter.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
healthy
Sets the overall health status.- Parameters:
healthy- true if healthy- Returns:
- this builder for chaining
-
activeConnections
Sets the active connection count.- Parameters:
count- the number of active connections- Returns:
- this builder for chaining
-
pendingOperations
Sets the pending operation count.- Parameters:
count- the number of pending operations- Returns:
- this builder for chaining
-
totalBytesSent
Sets the total bytes sent counter.- Parameters:
bytes- cumulative bytes sent- Returns:
- this builder for chaining
-
totalBytesReceived
Sets the total bytes received counter.- Parameters:
bytes- cumulative bytes received- Returns:
- this builder for chaining
-
lastError
Records an error, which also sets healthy to false.- Parameters:
timestamp- when the error occurredmessage- description of the error- Returns:
- this builder for chaining
-
build
-