Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.incubator.net.l2monitoring.soam.loss; |
| 17 | |
| 18 | import java.time.Duration; |
| 19 | |
| 20 | import org.onosproject.incubator.net.l2monitoring.soam.MilliPct; |
| 21 | |
| 22 | /** |
| 23 | * Abstract base interface for the creation of Loss Measurement Stat. |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 24 | * This is the base for {@link LossMeasurementStatHistory} |
| 25 | * and {@link LossMeasurementStatCurrent} |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 26 | */ |
| 27 | public interface LossMeasurementStat { |
| 28 | /** |
| 29 | * The time that the current Measurement Interval has been running. |
| 30 | * @return A java Duration |
| 31 | */ |
| 32 | Duration elapsedTime(); |
| 33 | |
| 34 | /** |
| 35 | * The suspect flag for the current measurement interval in which the notification was generated. |
| 36 | * reference MEF-SOAM-PM-MIB.mefSoamPmNotificationObjSuspect"; |
| 37 | * @return true if the measurement might include an error |
| 38 | */ |
| 39 | boolean suspectStatus(); |
| 40 | |
| 41 | /** |
| 42 | * The number of frames transmitted in the forward direction by this MEP. |
| 43 | * For a PM Session of types lmm or ccm this includes Ethernet Service Frames |
| 44 | * and SOAM PDUs that are in a higher MEG level only. |
| 45 | * For a PM Session of type slm this includes the count of SOAM ETH-SLM frames only |
| 46 | * @return The number of frames |
| 47 | */ |
| 48 | Long forwardTransmittedFrames(); |
| 49 | |
| 50 | /** |
| 51 | * The number of frames received in the forward direction by this MEP. |
| 52 | * For a PM Session of types lmm or ccm this includes Ethernet |
| 53 | * Service Frames and SOAM PDUs that are in a higher MEG level only. |
| 54 | * For a PM Session of type slm this includes the count of SOAM ETH-SLM frames only |
| 55 | * @return The number of frames received |
| 56 | */ |
| 57 | Long forwardReceivedFrames(); |
| 58 | |
| 59 | /** |
| 60 | * The minimum one-way frame loss ratio in the forward direction calculated by this MEP for this Interval. |
| 61 | * The FLR value is a ratio that is expressed as a percent with a value of |
| 62 | * 0 (ratio 0.00) through 100000 (ratio 1.00). |
| 63 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 64 | */ |
| 65 | MilliPct forwardMinFrameLossRatio(); |
| 66 | |
| 67 | /** |
| 68 | * The maximum one-way frame loss ratio in the forward direction calculated by this MEP for this Interval. |
| 69 | * The FLR value is a ratio that is expressed as a percent with a value of |
| 70 | * 0 (ratio 0.00) through 100000 (ratio 1.00). |
| 71 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 72 | */ |
| 73 | MilliPct forwardMaxFrameLossRatio(); |
| 74 | |
| 75 | /** |
| 76 | * The average one-way frame loss ratio in the forward direction calculated by this MEP for this Interval. |
| 77 | * The FLR value is a ratio that is expressed as a percent with a value of |
| 78 | * 0 (ratio 0.00) through 100000 (ratio 1.00). |
| 79 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 80 | */ |
| 81 | MilliPct forwardAverageFrameLossRatio(); |
| 82 | |
| 83 | /** |
| 84 | * The number of frames transmitted in the backward direction by this MEP. |
| 85 | * For a PM Session of type lmm or ccm this includes Ethernet Service Frames |
| 86 | * and SOAM PDUs that are in a higher MEG level only. |
| 87 | * For a PM Session of type slm this includes the count of SOAM ETH-SLM frames only |
| 88 | * @return The number of frames |
| 89 | */ |
| 90 | Long backwardTransmittedFrames(); |
| 91 | |
| 92 | /** |
| 93 | * The number of frames received in the backward direction by this MEP. |
| 94 | * For a PM Session of type lmm this includes Ethernet Service Frames and |
| 95 | * SOAM PDUs that are in a higher MEG level only. |
| 96 | * For a PM Session of type slm this includes the count of SOAM ETH-SLM frames only |
| 97 | * @return The number of frames |
| 98 | */ |
| 99 | Long backwardReceivedFrames(); |
| 100 | |
| 101 | /** |
| 102 | * The minimum one-way frame loss ratio in the backward direction. |
| 103 | * calculated by this MEP for this Measurement Interval. The FLR value is a |
| 104 | * ratio that is expressed as a percent with a value of 0 (ratio 0.00) |
| 105 | * through 100000 (ratio 1.00). |
| 106 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 107 | */ |
| 108 | MilliPct backwardMinFrameLossRatio(); |
| 109 | |
| 110 | /** |
| 111 | * The maximum one-way frame loss ratio in the backward direction. |
| 112 | * calculated by this MEP for this Measurement Interval. The FLR value is a |
| 113 | * ratio that is expressed as a percent with a value of 0 (ratio 0.00) |
| 114 | * through 100000 (ratio 1.00). |
| 115 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 116 | */ |
| 117 | MilliPct backwardMaxFrameLossRatio(); |
| 118 | |
| 119 | /** |
| 120 | * The average one-way frame loss ratio in the backward direction. |
| 121 | * calculated by this MEP for this Measurement Interval. The FLR value is a |
| 122 | * ratio that is expressed as a percent with a value of 0 (ratio 0.00) |
| 123 | * through 100000 (ratio 1.00). |
| 124 | * @return Units are in milli-percent, where 1 indicates 0.001 percent |
| 125 | */ |
| 126 | MilliPct backwardAverageFrameLossRatio(); |
| 127 | |
| 128 | /** |
| 129 | * The count of the number of SOAM PDUs sent during this Measurement Interval. |
| 130 | * This object applies when type is lmm, slm or ccm. It indicates the number |
| 131 | * of LMM, CCM, or SLM SOAM frames transmitted |
| 132 | * @return the number of SOAM PDUs sent |
| 133 | */ |
| 134 | Long soamPdusSent(); |
| 135 | |
| 136 | /** |
| 137 | * The count of the number of SOAM PDUs PDUs received in this Measurement Interval. |
| 138 | * This object applies when type is lmm, slm, or ccm. This object indicates |
| 139 | * the number of LMR, CCM, or SLR SOAM frames received |
| 140 | * @return the number of SOAM PDUs PDUs received |
| 141 | */ |
| 142 | Long soamPdusReceived(); |
| 143 | |
| 144 | /** |
Sean Condon | 3a1efef | 2018-02-24 13:16:03 +0000 | [diff] [blame] | 145 | * Base interface for builders of {@link LossMeasurementStat}. |
Sean Condon | 0e89bda | 2017-03-21 14:23:19 +0000 | [diff] [blame] | 146 | */ |
| 147 | interface LmStatBuilder { |
| 148 | LmStatBuilder forwardTransmittedFrames(Long forwardTransmittedFrames); |
| 149 | |
| 150 | LmStatBuilder forwardReceivedFrames(Long forwardReceivedFrames); |
| 151 | |
| 152 | LmStatBuilder forwardMinFrameLossRatio(MilliPct forwardMinFrameLossRatio); |
| 153 | |
| 154 | LmStatBuilder forwardMaxFrameLossRatio(MilliPct forwardMaxFrameLossRatio); |
| 155 | |
| 156 | LmStatBuilder forwardAverageFrameLossRatio(MilliPct forwardAverageFrameLossRatio); |
| 157 | |
| 158 | LmStatBuilder backwardTransmittedFrames(Long backwardTransmittedFrames); |
| 159 | |
| 160 | LmStatBuilder backwardReceivedFrames(Long backwardReceivedFrames); |
| 161 | |
| 162 | LmStatBuilder backwardMinFrameLossRatio(MilliPct backwardMinFrameLossRatio); |
| 163 | |
| 164 | LmStatBuilder backwardMaxFrameLossRatio(MilliPct backwardMaxFrameLossRatio); |
| 165 | |
| 166 | LmStatBuilder backwardAverageFrameLossRatio(MilliPct backwardAverageFrameLossRatio); |
| 167 | |
| 168 | LmStatBuilder soamPdusSent(Long soamPdusSent); |
| 169 | |
| 170 | LmStatBuilder soamPdusReceived(Long soamPdusReceived); |
| 171 | } |
| 172 | } |