-
Notifications
You must be signed in to change notification settings - Fork 63
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
Rework comment handling #420
Conversation
Signed-off-by: nook24 <[email protected]>
This PR reworks the comment handling to improve performance when having lots of comments. - it add a prev pointer to the comments list so we don't have to iterate over the complete list when removing an item - it replaces the hash lookup to quickly access comments for specific hosts/services in favor of a new host/service attribute which holds links to the comments - it avoids duplicate host/service lookups for DEL_ALL_HOST_COMMENTS/DEL_ALL_SVC_COMMENTS command - it removes hash functions which are now unused In general, it tries to adopt the downtime handling over to comments. This PR is based on naemon#375. Since the internal object structure changes, all NEB modules have to be rebuild. (We therefor increase CURRENT_NEB_API_VERSION to 6) Signed-off-by: Sven Nierlein <[email protected]>
Signed-off-by: Sven Nierlein <[email protected]>
swapped id and type parameter. Also start ids at 1 like before.
comment ids start at 1.
Hi, I am just not 100% sure what needs to happen for the sorting code for comment_list though. Does anyone know why we need to sort? |
I assumed the comment_list is required for livestatus, but i did a quick search and did not find any reference. It seems like comments are soley add/removed from broker callbacks. |
it is not required anymore since we store comments in a hash table now. Signed-off-by: Sven Nierlein <[email protected]>
31cdcf7
to
613a5b4
Compare
Alright, i completely removed the comments_list now. |
Nice thanks for this. |
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.
LGTM. Thanks!
host *temp_host = find_host(this_comment->host_name); | ||
remove_object_from_objectlist(&temp_host->comments_list, this_comment); | ||
} | ||
else if (type == SERVICE_COMMENT) { |
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.
Personally i would prefer a simple else
statement here
I have tested this with 400k comments, works as promised.
|
rework comment handling
This PR reworks the comment handling to improve performance when having lots of comments.
In general, it tries to adopt the downtime handling over to comments.
This PR is based on and includes #375.
Since the internal object structure changes, all NEB modules have to be rebuild. (We therefor increase CURRENT_NEB_API_VERSION to 6)
Signed-off-by: Sven Nierlein [email protected]