-
Notifications
You must be signed in to change notification settings - Fork 14
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
Calculating and updtating alert_count in every node sync #754
Conversation
tendrl-bug-id: Tendrl#753 Signed-off-by: GowthamShanmugasundaram <[email protected]>
@shtripat @shirshendu @r0h4n please review |
Each node will update read its own alerts only and it will update its own alerts count only |
@@ -164,10 +153,39 @@ def run(self): | |||
sync_cluster_contexts_thread.daemon = True | |||
sync_cluster_contexts_thread.start() | |||
sync_cluster_contexts_thread.join() | |||
|
|||
# Update node alert count | |||
update_node_alert_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to do this every sync as an overwrite, or re-calculate only if node is deleted due to TTL? @r0h4n comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be done only if NS.tendrl.objects.NodeAlertCounters.exists() is False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will change this
@@ -164,10 +153,39 @@ def run(self): | |||
sync_cluster_contexts_thread.daemon = True | |||
sync_cluster_contexts_thread.start() | |||
sync_cluster_contexts_thread.join() | |||
|
|||
# Update node alert count | |||
update_node_alert_count() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be done only if NS.tendrl.objects.NodeAlertCounters.exists() is False
tendrl-bug-id: Tendrl#753 Signed-off-by: GowthamShanmugasundaram <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #754 +/- ##
=========================================
Coverage ? 42.65%
=========================================
Files ? 72
Lines ? 2846
Branches ? 407
=========================================
Hits ? 1214
Misses ? 1583
Partials ? 49
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine
@@ -164,10 +153,40 @@ def run(self): | |||
sync_cluster_contexts_thread.daemon = True | |||
sync_cluster_contexts_thread.start() | |||
sync_cluster_contexts_thread.join() | |||
|
|||
# Update node alert count | |||
if not NS.tendrl.objects.NodeAlertCounters().exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be increment the alert count if NS.tendrl.objects.NodeAlertCounters().exists():
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r0h4n When node details are deleted by ttl or initially if alert count object is not present so at that time only it will save alert count object in etcd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion
tendrl-bug-id: #753
Signed-off-by: GowthamShanmugasundaram [email protected]