New events client to support Streaming structured events.#3
Closed
renukamanavalan wants to merge 13 commits intomasterfrom
Closed
New events client to support Streaming structured events.#3renukamanavalan wants to merge 13 commits intomasterfrom
renukamanavalan wants to merge 13 commits intomasterfrom
Conversation
gnmi_cli -client_types=gnmi -a 127.0.0.1:50051 -t EVENTS -logtostderr -insecure -v 7 -streaming_type ON_CHANGE -q aaa/bbb -qt s
Adding client to receive & send to subscribing clients
zbud-msft
reviewed
Aug 6, 2022
| // Stats counter | ||
| counters map[string]uint64 | ||
|
|
||
| last_latencies [LATENCT_LIST_SIZE]int64; |
Owner
Author
There was a problem hiding this comment.
The update is not reflecting. Let me check
| var total uint64 = 0 | ||
| var cnt int = 0 | ||
|
|
||
| for _ v := range evtc.last_latencies { |
| cnt++ | ||
| } | ||
| } | ||
| evtc.counters[LATENCY] = (int64) (total/cnt/1000/1000) |
There was a problem hiding this comment.
What happens if last_latencies are all 0, wouldnt this be divide by 0 error?
| /* Init current values for cumulative keys and clear for absolute */ | ||
| for _, key := range STATS_CUMULATIVE_KEYS { | ||
| fv, err := rclient.HGetAll(key).Result() | ||
| db_counters[key] = fv[STATS_FIELD_NAME] |
| }) | ||
|
|
||
| var db_counters map[string]uint64 | ||
| var wr_counters *map[string]uint64 = NULL; |
There was a problem hiding this comment.
uninitialized value is nil by default
| db_counters[key] = fv[STATS_FIELD_NAME] | ||
| } | ||
| for _, key := range STATS_ABSOLUTE_KEYS { | ||
| db_counters[key] = 0; |
| } | ||
| tmp_counters[DROPPED] += evtc.last_errors | ||
|
|
||
| if (wr_counters != nil) && !reflect.DeepEqual(tmp_counters, *wr_counters) { |
There was a problem hiding this comment.
Can you add some comments for this block of code? When is wr_counters not nil? Is line 157 supposed to be outside of this block?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refer HLD #954