Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
danet
bio-rd
Commits
1574453b
Unverified
Commit
1574453b
authored
5 years ago
by
Christoph Petrausch
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into ris/keepalive
parents
eb1f84c6
f7cd2d04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/ris/risserver/server.go
+28
-0
28 additions, 0 deletions
cmd/ris/risserver/server.go
with
28 additions
and
0 deletions
cmd/ris/risserver/server.go
+
28
−
0
View file @
1574453b
...
...
@@ -11,12 +11,35 @@ import (
"github.com/bio-routing/bio-rd/routingtable/filter"
"github.com/bio-routing/bio-rd/routingtable/locRIB"
"github.com/prometheus/client_golang/prometheus"
pb
"github.com/bio-routing/bio-rd/cmd/ris/api"
bnet
"github.com/bio-routing/bio-rd/net"
netapi
"github.com/bio-routing/bio-rd/net/api"
routeapi
"github.com/bio-routing/bio-rd/route/api"
)
var
(
risObserveFIBClients
*
prometheus
.
GaugeVec
)
func
init
()
{
risObserveFIBClients
=
prometheus
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
"bio"
,
Subsystem
:
"ris"
,
Name
:
"observe_fib_clients"
,
Help
:
"number of observe FIB clients per router/vrf/afisafi"
,
},
[]
string
{
"router"
,
"vrf"
,
"afisafi"
,
},
)
prometheus
.
MustRegister
(
risObserveFIBClients
)
}
// Server represents an RoutingInformationService server
type
Server
struct
{
bmp
*
server
.
BMPServer
...
...
@@ -114,6 +137,7 @@ func (s *Server) GetLonger(ctx context.Context, req *pb.GetLongerRequest) (*pb.G
return
res
,
nil
}
// ObserveRIB implements the ObserveRIB RPC
func
(
s
*
Server
)
ObserveRIB
(
req
*
pb
.
ObserveRIBRequest
,
stream
pb
.
RoutingInformationService_ObserveRIBServer
)
error
{
ipVersion
:=
netapi
.
IP_IPv4
switch
req
.
Afisafi
{
...
...
@@ -130,6 +154,9 @@ func (s *Server) ObserveRIB(req *pb.ObserveRIBRequest, stream pb.RoutingInformat
return
err
}
risObserveFIBClients
.
WithLabelValues
(
req
.
Router
,
fmt
.
Sprintf
(
"%d"
,
req
.
VrfId
),
fmt
.
Sprintf
(
"%d"
,
req
.
Afisafi
))
.
Inc
()
defer
risObserveFIBClients
.
WithLabelValues
(
req
.
Router
,
fmt
.
Sprintf
(
"%d"
,
req
.
VrfId
),
fmt
.
Sprintf
(
"%d"
,
req
.
Afisafi
))
.
Dec
()
fifo
:=
newUpdateFIFO
()
rc
:=
newRIBClient
(
fifo
)
ret
:=
make
(
chan
error
)
...
...
@@ -162,6 +189,7 @@ func (s *Server) ObserveRIB(req *pb.ObserveRIBRequest, stream pb.RoutingInformat
return
nil
}
// DumpRIB implements the DumpRIB RPC
func
(
s
*
Server
)
DumpRIB
(
req
*
pb
.
DumpRIBRequest
,
stream
pb
.
RoutingInformationService_DumpRIBServer
)
error
{
ipVersion
:=
netapi
.
IP_IPv4
switch
req
.
Afisafi
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment