use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.QosPolicy in project netvirt by opendaylight.
the class QosAlertPortData method calculateAlertCondition.
private void calculateAlertCondition(NodeConnectorStatisticsAndPortNumberMap statsData) {
BigInteger rxDiff = statsData.getPackets().getReceived().subtract(rxPackets);
BigInteger rxDroppedDiff = statsData.getReceiveDrops().subtract(rxDroppedPackets);
BigInteger rxTotalDiff = rxDiff.add(rxDroppedDiff);
LOG.trace("Port {} rxDiff:{} rxDropped diff:{} total diff:{}", port.getUuid(), rxDiff, rxDroppedDiff, rxTotalDiff);
QosPolicy qosPolicy = qosNeutronUtils.getQosPolicy(port);
if (qosPolicy == null) {
return;
}
if (rxDroppedDiff.multiply(BIG_HUNDRED).compareTo(rxTotalDiff.multiply(alertThreshold.get())) > 0) {
LOG.trace(QosConstants.ALERT_MSG_FORMAT, qosPolicy.getName(), qosPolicy.getUuid().getValue(), port.getUuid().getValue(), port.getNetworkId().getValue(), statsData.getPackets().getReceived(), statsData.getReceiveDrops());
QosAlertGenerator.raiseAlert(qosPolicy.getName(), qosPolicy.getUuid().getValue(), port.getUuid().getValue(), port.getNetworkId().getValue(), statsData.getPackets().getReceived(), statsData.getReceiveDrops());
}
}
Aggregations