Skip to content

Commit 9d5406d

Browse files
committed
Address community review comments
Eliminate oldest events if the number of events exceed the threshold Signed-off-by: Stephen Sun <[email protected]>
1 parent 90c18de commit 9d5406d

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

src/sonic-yang-models/doc/Configuration.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HE
392392
"notice": {
393393
"categories": [
394394
"asic_hw"
395-
]
395+
],
396+
"max_events": "1000"
396397
},
397398
"warning": {
398399
"categories": [

src/sonic-yang-models/tests/yang_model_tests/tests/suppress_asic_sdk_health_event.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
"desc": "Load suppress ASIC/SDK health event list for notice.",
1313
"eStrKey": "InvalidValue"
1414
},
15-
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_CATEGORY": {
16-
"desc": "Load MUX_TUNNEL missing name.",
15+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": {
16+
"desc": "Load suppress ASIC/SDK health event list missing name.",
17+
"eStrKey": "InvalidValue"
18+
},
19+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": {
20+
"desc": "Load suppress ASIC/SDK health event list missing name.",
1721
"eStrKey": "InvalidValue"
1822
}
1923
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/suppress_asic_sdk_health_event.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
3232
{
3333
"severity": "notice",
34-
"categories": ["software","firmware","cpu_hw","asic_hw"]
34+
"categories": ["software","firmware","cpu_hw","asic_hw"],
35+
"max_events": "100"
3536
}
3637
]
3738
}
@@ -62,5 +63,31 @@
6263
]
6364
}
6465
}
66+
},
67+
68+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": {
69+
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
70+
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
71+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
72+
{
73+
"severity": "notice",
74+
"max_events": "-1"
75+
}
76+
]
77+
}
78+
}
79+
},
80+
81+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": {
82+
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
83+
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
84+
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
85+
{
86+
"severity": "notice",
87+
"max_events": "NaN"
88+
}
89+
]
90+
}
91+
}
6592
}
6693
}

src/sonic-yang-models/yang-models/sonic-suppress-asic-sdk-health-event.yang

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ module sonic-suppress-asic-sdk-health-event {
3939
description "Severity of the ASIC/SDK health event to suppress";
4040
}
4141

42+
leaf max_events {
43+
type uint32;
44+
}
45+
4246
leaf-list categories {
4347
type enumeration {
4448
enum software;

0 commit comments

Comments
 (0)