Skip to content

Commit 4d8a8da

Browse files
committed
[status] Update onu metrics for monitoring
1 parent 510fcb6 commit 4d8a8da

File tree

4 files changed

+22
-43
lines changed

4 files changed

+22
-43
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -588,20 +588,23 @@ metric format for the CRORC and the CRU is different, as different parameters ar
588588
589589
###### Metric: `"onu"`
590590
591-
| Value name - | Value | Type |
592-
| ---------------------| --------------------------- | ------ |
593-
| `"onuStickyStatus"` | 0/1 (DOWN/UP) | int |
594-
| `"onuAddress"` | ONU Address | int |
595-
| `"rx40Locked"` | 0/1 (False/True) | int |
596-
| `"phaseGood"` | 0/1 (False/True) | int |
597-
| `"rxLocked"` | 0/1 (False/True) | int |
598-
| `"operational"` | 0/1 (False/True) | int |
599-
| `"mgtTxReady"` | 0/1 (False/True) | int |
600-
| `"mgtRxReady"` | 0/1 (False/True) | int |
601-
| `"mgtTxPllLocked"` | 0/1 (False/True) | int |
602-
| `"mgtRxPllLocked"` | 0/1 (False/True) | int |
603-
| `"ponQualityStatus"` | 0/1 (Bad/Good) | int |
604-
| `"ponRxPower"` | dBm | int |
591+
| Value name | Value | Type |
592+
| ----------------------- | ------------------------------ | ------ |
593+
| `"onuDownstreamStatus"` | 0/1 (DOWN/UP) | int |
594+
| `"onuUpstreamStatus"` | 0/1 (DOWN/UP) | int |
595+
| `"onuStickyValue"` | 8-bit | int |
596+
| `"onuStickyVaulePrev"` | 8-bit | int |
597+
| `"onuAddress"` | ONU Address | int |
598+
| `"rx40Locked"` | 0/1 (False/True) | int |
599+
| `"phaseGood"` | 0/1 (False/True) | int |
600+
| `"rxLocked"` | 0/1 (False/True) | int |
601+
| `"operational"` | 0/1 (False/True) | int |
602+
| `"mgtTxReady"` | 0/1 (False/True) | int |
603+
| `"mgtRxReady"` | 0/1 (False/True) | int |
604+
| `"mgtTxPllLocked"` | 0/1 (False/True) | int |
605+
| `"mgtRxPllLocked"` | 0/1 (False/True) | int |
606+
| `"ponQualityStatus"` | 0/1 (Bad/Good) | int |
607+
| `"ponRxPower"` | dBm | int |
605608
606609
| Tag key | Value |
607610
| --------------------- | --------------------- |

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -250,28 +250,15 @@ class ProgramStatus : public Program
250250
uint32_t onuStickyValue = onuStatus.stickyStatus.stickyValue;
251251
uint32_t onuStickyValuePrev = onuStatus.stickyStatus.stickyValuePrev;
252252

253-
// TODO: remove when monitoring is updated
254-
std::string onuStickyStatus;
255-
int onuStickyStatusInt = 0;
256-
257-
if (onuStatus.stickyStatus.monStatus == Cru::LinkStatus::Up) {
258-
onuStickyStatus = "UP";
259-
onuStickyStatusInt = 1;
260-
} else if (onuStatus.stickyStatus.monStatus == Cru::LinkStatus::UpWasDown) {
261-
onuStickyStatus = "UP (was DOWN)";
262-
// force status = 1 (vs = 2) when UP(was DOWN) for monitoring
263-
onuStickyStatusInt = 1;
264-
} else if (onuStatus.stickyStatus.monStatus == Cru::LinkStatus::Down) {
265-
onuStickyStatus = "DOWN";
266-
onuStickyStatusInt = 0;
267-
}
268-
269253
std::string ponQualityStatusStr;
270254
ponQualityStatusStr = onuStatus.ponQualityStatus ? "good" : "bad";
271255

272256
if (mOptions.monitoring) {
273257
monitoring->send(Metric{ "onu" }
274-
.addValue(onuStickyStatusInt, "onuStickyStatus")
258+
.addValue(onuStatus.stickyStatus.upstreamStatus, "onuUpstreamStatus")
259+
.addValue(onuStatus.stickyStatus.downstreamStatus, "onuDownstreamStatus")
260+
.addValue(int(onuStatus.stickyStatus.stickyValue), "onuStickyValue")
261+
.addValue(int(onuStatus.stickyStatus.stickyValuePrev), "onuStickyVaulePrev")
275262
.addValue(int(onuStatus.onuAddress), "onuAddress")
276263
.addValue(onuStatus.rx40Locked, "rx40Locked")
277264
.addValue(onuStatus.phaseGood, "phaseGood")

src/Cru/Common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ struct ReportInfo {
118118
};
119119

120120
struct OnuStickyStatus {
121-
LinkStatus monStatus; // TODO: Remove after monitoring is updated
122121
LinkStatus upstreamStatus;
123122
LinkStatus downstreamStatus;
124123
uint32_t stickyValue;
@@ -135,10 +134,7 @@ struct OnuStatus {
135134
bool mgtRxReady;
136135
bool mgtTxPllLocked;
137136
bool mgtRxPllLocked;
138-
/* NEW */
139-
//LinkStatus stickyBit;
140137
OnuStickyStatus stickyStatus;
141-
/* NEW */
142138
uint32_t ponQuality;
143139
int ponQualityStatus;
144140
double ponRxPower;

src/Cru/Ttc.cxx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ bool Ttc::configurePonTx(uint32_t onuAddress)
152152
// from rogue invocations of roc-status
153153
OnuStickyStatus Ttc::getOnuStickyStatus(bool monitoring)
154154
{
155-
LinkStatus monStatus = LinkStatus::Down, upstreamStatus = LinkStatus::Down, downstreamStatus = LinkStatus::Down;
155+
LinkStatus upstreamStatus = LinkStatus::Down, downstreamStatus = LinkStatus::Down;
156156
uint32_t was, is;
157157
if (monitoring) {
158158
was = mBar->readRegister(Cru::Registers::TTC_ONU_STICKY_MON.index);
@@ -173,14 +173,7 @@ OnuStickyStatus Ttc::getOnuStickyStatus(bool monitoring)
173173
downstreamStatus = LinkStatus::Up;
174174
}
175175

176-
if (was == 0x0 && is == 0x0) {
177-
monStatus = LinkStatus::Up;
178-
} else if (was != 0x0 && is == 0x0) {
179-
monStatus = LinkStatus::UpWasDown;
180-
}
181-
182176
return {
183-
monStatus,
184177
upstreamStatus,
185178
downstreamStatus,
186179
is,

0 commit comments

Comments
 (0)