Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Merge requests
!21
Draft: Feature/pol1 744 fix speed issues
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Feature/pol1 744 fix speed issues
feature/POL1-744-fix-speed-issues
into
develop
Overview
6
Commits
4
Pipelines
0
Changes
1
4 unresolved threads
Hide all comments
Closed
Sam Roberts
requested to merge
feature/POL1-744-fix-speed-issues
into
develop
1 year ago
Overview
6
Commits
4
Pipelines
0
Changes
1
4 unresolved threads
Hide all comments
Expand
Fix interface-info timeouts
Make the poller speed endpoint use the data retrieved without it disappearing into the ether never to be used by anything
0
0
Merge request reports
Viewing commit
5f6087f6
Prev
Next
Show latest version
1 file
+
9
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
5f6087f6
fetch all required redis docs in one call (slow but functional)
· 5f6087f6
Sam Roberts
authored
1 year ago
inventory_provider/routes/poller.py
+
9
−
5
Options
@@ -701,13 +701,17 @@ def _load_interfaces(
def
_add_speeds
(
config
,
interfaces
):
all_netconf_interfaces
=
list
(
common
.
load_json_docs
(
config
,
'
classifier-cache:netconf-interfaces:all
'
))
netconf_interface_index
=
{
f
"
{
ifc
[
'
router
'
]
}
---
{
ifc
[
'
name
'
]
}
"
:
ifc
for
ifc
in
all_netconf_interfaces
[
0
][
'
value
'
]}
all_netconf_interfaces
=
list
(
common
.
load_json_docs
(
config
,
'
netconf-interfaces:*
'
))
netconf_interface_index
=
{}
for
netconf_interface_doc
in
all_netconf_interfaces
:
nc_ifc
=
netconf_interface_doc
[
'
value
'
]
if
'
router
'
in
nc_ifc
and
'
name
'
in
nc_ifc
:
netconf_interface_index
[
f
"
{
nc_ifc
[
'
router
'
]
}
---
{
nc_ifc
[
'
name
'
]
}
"
]
=
nc_ifc
for
ifc
in
interfaces
:
n
etconf_interface
=
netconf_interface_index
.
get
(
f
"
{
ifc
[
'
router
'
]
}
---
{
ifc
[
'
name
'
]
}
"
,
{})
if
'
speed
'
in
n
etconf_interface
:
ifc
[
'
speed
'
]
=
n
etconf_interface
[
'
speed
'
]
n
c_ifc
=
netconf_interface_index
.
get
(
f
"
{
ifc
[
'
router
'
]
}
---
{
ifc
[
'
name
'
]
}
"
,
{})
if
'
speed
'
in
n
c_ifc
:
ifc
[
'
speed
'
]
=
n
c_ifc
[
'
speed
'
]
else
:
ifc
[
'
speed
'
]
=
''
yield
ifc
Loading