use of io.grpc.channelz.v1.SocketData in project grpc-java by grpc.
the class ChannelzProtoUtil method extractSocketData.
static SocketData extractSocketData(SocketStats socketStats) {
SocketData.Builder builder = SocketData.newBuilder();
if (socketStats.data != null) {
TransportStats s = socketStats.data;
builder.setStreamsStarted(s.streamsStarted).setStreamsSucceeded(s.streamsSucceeded).setStreamsFailed(s.streamsFailed).setMessagesSent(s.messagesSent).setMessagesReceived(s.messagesReceived).setKeepAlivesSent(s.keepAlivesSent).setLastLocalStreamCreatedTimestamp(Timestamps.fromNanos(s.lastLocalStreamCreatedTimeNanos)).setLastRemoteStreamCreatedTimestamp(Timestamps.fromNanos(s.lastRemoteStreamCreatedTimeNanos)).setLastMessageSentTimestamp(Timestamps.fromNanos(s.lastMessageSentTimeNanos)).setLastMessageReceivedTimestamp(Timestamps.fromNanos(s.lastMessageReceivedTimeNanos)).setLocalFlowControlWindow(Int64Value.of(s.localFlowControlWindow)).setRemoteFlowControlWindow(Int64Value.of(s.remoteFlowControlWindow));
}
builder.addAllOption(toSocketOptionsList(socketStats.socketOptions));
return builder.build();
}
Aggregations