[Flex Counters] Reset flex counters delay flag on config DB when enable_counters script is called (#8500)

#### Why I did it
Reset flex counters delay flag on config DB when enable_counters script is called to allow enablement of flex counters in orchagent.

#### How I did it
Push to config DB 'false' value for delay indication when enable_counters script is called before enabling the counters.

#### How to verify it
Observe counters are created when enable_counters script is called.
This commit is contained in:
shlomibitton 2021-09-02 07:17:36 +03:00 committed by Judy Joseph
parent e925339a7e
commit be5236b3b5
2 changed files with 43 additions and 0 deletions

View File

@ -17,6 +17,9 @@ def enable_counter_group(db, name):
info = {}
info['FLEX_COUNTER_STATUS'] = 'enable'
db.mod_entry("FLEX_COUNTER_TABLE", name, info)
else:
entry_info.update({"FLEX_COUNTER_DELAY_STATUS":"false"})
db.mod_entry("FLEX_COUNTER_TABLE", name, entry_info)
def enable_rates():
# set the default interval for rates

View File

@ -23,6 +23,10 @@ module sonic-flex_counter {
}
}
typedef flex_delay_status {
type boolean;
}
description "FLEX_COUNTER_TABLE part of config_db.json";
/* below are in alphabetical order */
@ -32,6 +36,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container DEBUG_COUNTER {
@ -39,6 +46,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PFCWD {
@ -46,6 +56,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PG_DROP {
@ -53,6 +66,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PG_WATERMARK {
@ -60,6 +76,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PORT {
@ -67,6 +86,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PORT_RATES {
@ -74,6 +96,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container PORT_BUFFER_DROP {
@ -81,6 +106,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container QUEUE {
@ -88,6 +116,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container QUEUE_WATERMARK {
@ -95,6 +126,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container RIF {
@ -102,6 +136,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
container RIF_RATES {
@ -109,6 +146,9 @@ module sonic-flex_counter {
leaf FLEX_COUNTER_STATUS {
type flex_status;
}
leaf FLEX_COUNTER_DELAY_STATUS {
type flex_delay_status;
}
}
}