Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lua script to convert poll_interval to MS #3

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions orchagent/rif_rates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ for i = 1, n do
local out_pkts_last = redis.call('HGET', rates_table_name .. ':' .. KEYS[i], 'SAI_ROUTER_INTERFACE_STAT_OUT_PACKETS_last')

-- Calculate new rates values
local rx_bps_new = (in_octets - in_octets_last)/delta
local tx_bps_new = (out_octets - out_octets_last)/delta
local rx_pps_new = (in_pkts - in_pkts_last)/delta
local tx_pps_new = (out_pkts - out_pkts_last)/delta
local rx_bps_new = (in_octets - in_octets_last) / delta * 1000
local tx_bps_new = (out_octets - out_octets_last) / delta * 1000
local rx_pps_new = (in_pkts - in_pkts_last) / delta * 1000
local tx_pps_new = (out_pkts - out_pkts_last) / delta * 1000

if initialized == "DONE" then
-- Get old rates values
Expand Down