Skip to content

Commit b5eafea

Browse files
author
Mykola Faryma
committed
add descriptive comment
Signed-off-by: Mykola Faryma <[email protected]>
1 parent cfb5cca commit b5eafea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dockers/docker-orchagent/enable_counters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import swsssdk
44
import time
55

6+
# ALPHA defines the size of the window over which we calculate the average value. ALPHA is 2/(N+1) where N is the interval(window size)
7+
# In this case we configure the window to be 10s. This way if we have a huge 1s spike in traffic,
8+
# the average rate value will show a curve descending from the spike to the usual rate over approximately 10s.
69
DEFAULT_SMOOTH_INTERVAL = '10'
710
DEFAULT_ALPHA = '0.18'
811

@@ -12,7 +15,7 @@ def enable_counter_group(db, name):
1215
db.mod_entry("FLEX_COUNTER_TABLE", name, info)
1316

1417
def enable_rates():
15-
# set the default interval for rates (N) as 10s, alpha is 2/(N+1)
18+
# set the default interval for rates
1619
counters_db = swsssdk.SonicV2Connector()
1720
counters_db.connect('COUNTERS_DB')
1821
counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_SMOOTH_INTERVAL', DEFAULT_SMOOTH_INTERVAL)

0 commit comments

Comments
 (0)