Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
tweak javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Jerry Shea <jerry.shea@chronicle.software>
  • Loading branch information
JerryShea committed Jun 9, 2023
1 parent c528715 commit 39ecd4a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,32 @@ static <N extends NetworkContext<N>> void notifyHostPort(@Nullable final Chronic

void networkContext(N networkContext);

/**
* Called periodically (see tcp.event.monitor.secs system property) with summary network stats
*
* @param writeBps write Bytes/sec
* @param readBps read Bytes/sec
* @param socketPollCountPerSecond socket poll count/sec
*/
void onNetworkStats(long writeBps, long readBps, long socketPollCountPerSecond);

void onHostPort(String hostName, int port);

/**
* Notification of individual round trip latency, called only if acknowledge enabled
*
* @param nanosecondLatency latency
*/
void onRoundTripLatency(long nanosecondLatency);

default void procPrefix(String procPrefix) {
}

/**
* Notification of individual message one way trip latency (requires sender's clock to be synchronised with receiver's)
*
* @param nanosecondLatency latency
*/
default void onReceiveLatency(long nanosecondLatency) {
}
}
35 changes: 35 additions & 0 deletions src/main/java/net/openhft/chronicle/network/api/NetworkStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public NetworkStats userId(String userId) {
return this;
}

/**
* Bytes written per second
*
* @return write Bytes/sec
*/
public long writeBps() {
return writeBps;
}
Expand All @@ -68,6 +73,11 @@ public NetworkStats writeBps(long writeBps) {
return this;
}

/**
* Bytes read per second
*
* @return read Bytes/sec
*/
public long readBps() {
return readBps;
}
Expand Down Expand Up @@ -104,6 +114,11 @@ public NetworkStats index(long index) {
return this;
}

/**
* Timestamp of last update to this, from {@link System#currentTimeMillis()}
*
* @return timestamp in millis
*/
public long timestamp() {
return timestamp;
}
Expand All @@ -113,6 +128,11 @@ public NetworkStats timestamp(long timestamp) {
return this;
}

/**
* Socket polls per second
*
* @return socket polls/sec
*/
public long socketPollRate() {
return socketPollRate;
}
Expand All @@ -122,6 +142,11 @@ public NetworkStats socketPollRate(long socketPollRate) {
return this;
}

/**
* Local identifier (hostId)
*
* @return local hostId
*/
public int localIdentifier() {
return localIdentifier;
}
Expand Down Expand Up @@ -212,6 +237,11 @@ public NetworkStats clientId(UUID clientId) {
return this;
}

/**
* Remote host name as determined at connection time
*
* @return remote host name
*/
public String remoteHostName() {
return remoteHostName;
}
Expand All @@ -221,6 +251,11 @@ public NetworkStats remoteHostName(String remoteHostName) {
return this;
}

/**
* Remote port as determined at connection time
*
* @return remote port
*/
public int remotePort() {
return remotePort;
}
Expand Down

0 comments on commit 39ecd4a

Please sign in to comment.