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

refactor: discovery protocols re-write #7380

Merged
merged 7 commits into from Oct 4, 2017

Conversation

Projects
None yet
4 participants
@murrant
Member

murrant commented Sep 22, 2017

extract more code to make it easier to read
use snmpwalk_group
walk lldpRemTable instead of lldpRemoteSystemsData
Optimize discover_device to reduce dns lookups of bad dns names
Make discovery_by_ip behavior consistent between cdp and lldp
move can_skip_discovery to discovery functions

Tested lldp, cdp, and ospf.

discovery-protocols went from 50s to 1.5s on one test device

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926


This change is Reviewable

@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Sep 22, 2017

Thank you for submitting a PR @murrant! We have found the following @laf, @vitalisator and @tuxis-ie based on the history of these files to review this PR.

mention-bot commented Sep 22, 2017

Thank you for submitting a PR @murrant! We have found the following @laf, @vitalisator and @tuxis-ie based on the history of these files to review this PR.

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Sep 23, 2017

Member

Reviewed 3 of 5 files at r1, 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


includes/discovery/discovery-protocols.inc.php, line 29 at r2 (raw file):

                }

                if ($remote_device_id) {

Is it not worth leaving this check in place still?


Comments from Reviewable

Member

laf commented Sep 23, 2017

Reviewed 3 of 5 files at r1, 2 of 2 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


includes/discovery/discovery-protocols.inc.php, line 29 at r2 (raw file):

                }

                if ($remote_device_id) {

Is it not worth leaving this check in place still?


Comments from Reviewable

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Sep 23, 2017

Member

I have no way to test this :(

Only one comment in the code from me.

Member

laf commented Sep 23, 2017

I have no way to test this :(

Only one comment in the code from me.

@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Sep 25, 2017

Member

Review status: all files reviewed at latest revision, 1 unresolved discussion.


includes/discovery/discovery-protocols.inc.php, line 29 at r2 (raw file):

Previously, laf (Neil Lathwood) wrote…

Is it not worth leaving this check in place still?

It was removed for consistency. Others add links whether or not the remote device exists in the database. I thought that if we have that information, we can maybe display it at some point as someone requested.


Comments from Reviewable

Member

murrant commented Sep 25, 2017

Review status: all files reviewed at latest revision, 1 unresolved discussion.


includes/discovery/discovery-protocols.inc.php, line 29 at r2 (raw file):

Previously, laf (Neil Lathwood) wrote…

Is it not worth leaving this check in place still?

It was removed for consistency. Others add links whether or not the remote device exists in the database. I thought that if we have that information, we can maybe display it at some point as someone requested.


Comments from Reviewable

@murrant murrant added the Schema label Sep 25, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Oct 3, 2017

Member

@murrant conflict on the schema.

Member

laf commented Oct 3, 2017

@murrant conflict on the schema.

murrant added some commits Sep 22, 2017

refactor: discovery protocols re-write
extract more code to make it easier to read
use snmpwalk_group
walk lldpRemTable instead of lldpRemoteSystemsData
Optimize discover_device to reduce dns lookups of bad dns names
Make discovery_by_ip behavior consistent between cdp and lldp
move can_skip_discovery to discovery functions

Tested lldp, cdp, and ospf.
@murrant

This comment has been minimized.

Show comment
Hide comment
@murrant

murrant Oct 4, 2017

Member

Updated

Member

murrant commented Oct 4, 2017

Updated

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Oct 4, 2017

The inspection completed: No new issues

scrutinizer-notifier commented Oct 4, 2017

The inspection completed: No new issues

@laf laf merged commit c0b267b into librenms:master Oct 4, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@murrant murrant deleted the murrant:improve-discovery-proto branch Oct 4, 2017

@lock

This comment has been minimized.

Show comment
Hide comment
@lock

lock bot May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

lock bot commented May 17, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 17, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.