private void printNetLog(StringBuilder sb, MeasurementNode osNode) { MeasurementNode netNode = osNode.findChild(OsMeter.OS_TYPE_NET); if (netNode == null || netNode.getMeasurements().isEmpty()) { return; } appendLine(sb, " net:"); appendLine(sb, " send(Bps) recv(Bps) send(pps) recv(pps) interface"); StringBuilder tmpSb = new StringBuilder(); for (MeasurementNode interfaceNode : netNode.getChildren().values()) { double sendRate = interfaceNode.findChild(NetMeter.TAG_SEND.value()).summary(); double sendPacketsRate = interfaceNode.findChild(NetMeter.TAG_PACKETS_SEND.value()).summary(); double receiveRate = interfaceNode.findChild(NetMeter.TAG_RECEIVE.value()).summary(); double receivePacketsRate = interfaceNode.findChild(NetMeter.TAG_PACKETS_RECEIVE.value()).summary(); if (sendRate == 0 && receiveRate == 0 && receivePacketsRate == 0 && sendPacketsRate == 0) { continue; } appendLine(tmpSb, " %-12s %-12s %-12s %-12s %s", NetUtils.humanReadableBytes((long) sendRate), NetUtils.humanReadableBytes((long) receiveRate), NetUtils.humanReadableBytes((long) sendPacketsRate), NetUtils.humanReadableBytes((long) receivePacketsRate), interfaceNode.getName()); } if (tmpSb.length() != 0) { sb.append(tmpSb.toString()); } }
address.findChild(EndpointMeter.DISCONNECT_COUNT).summary(), address.findChild(EndpointMeter.CONNECTIONS).summary(), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_WRITTEN).summary()), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_READ).summary()) ); disconnect, connections, NetUtils.humanReadableBytes((long) writeSize), NetUtils.humanReadableBytes((long) readSize) );
address.findChild(ServerEndpointMeter.REJECT_BY_CONNECTION_LIMIT).summary(), address.findChild(EndpointMeter.CONNECTIONS).summary(), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_WRITTEN).summary()), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_READ).summary()) ); reject, connections, NetUtils.humanReadableBytes((long) writeSize), NetUtils.humanReadableBytes((long) readSize) );
private void printNetLog(StringBuilder sb, MeasurementNode osNode) { MeasurementNode netNode = osNode.findChild(OsMeter.OS_TYPE_NET); if (netNode == null || netNode.getMeasurements().isEmpty()) { return; } appendLine(sb, " net:"); appendLine(sb, " send receive interface"); StringBuilder tmpSb = new StringBuilder(); for (MeasurementNode interfaceNode : netNode.getChildren().values()) { double sendRate = interfaceNode.findChild(NetMeter.TAG_SEND.value()).summary(); double receiveRate = interfaceNode.findChild(NetMeter.TAG_RECEIVE.value()).summary(); if (sendRate == 0 && receiveRate == 0) { continue; } appendLine(tmpSb, " %-12s %-12s %s", NetUtils.humanReadableBytes((long) sendRate), NetUtils.humanReadableBytes((long) receiveRate), interfaceNode.getName()); } if (tmpSb.length() != 0) { sb.append(tmpSb.toString()); } }
address.findChild(EndpointMeter.DISCONNECT_COUNT).summary(), address.findChild(EndpointMeter.CONNECTIONS).summary(), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_WRITTEN).summary()), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_READ).summary()) ); disconnect, connections, NetUtils.humanReadableBytes((long) writeSize), NetUtils.humanReadableBytes((long) readSize) );
address.findChild(ServerEndpointMeter.REJECT_BY_CONNECTION_LIMIT).summary(), address.findChild(EndpointMeter.CONNECTIONS).summary(), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_WRITTEN).summary()), NetUtils.humanReadableBytes((long) address.findChild(EndpointMeter.BYTES_READ).summary()) ); reject, connections, NetUtils.humanReadableBytes((long) writeSize), NetUtils.humanReadableBytes((long) readSize) );