Skip to content
Snippets Groups Projects
Commit 7992b738 authored by S.H.'s avatar S.H.
Browse files

implement simple propagation delay benchmark in RtdtManager, add option to...

implement simple propagation delay benchmark in RtdtManager, add option to save ChangeRequests of successfully applied changes so they can later be applied back to realnet from a virtual venv
Merged diverging branches
parent 21825fa6
Branches
No related tags found
No related merge requests found
Pipeline #262606 failed
system/config/hostname
system/config/domain-name
......@@ -70,7 +70,7 @@ func main() {
// Do performance tests of realnet before starting twin
if benchmark {
fmt.Println("Now doing performance measurements of gosdn's propagation delay ")
rtdtMan.RunBenchmark()
rtdtMan.RunBenchmark0()
}
if withTwin {
......
......@@ -64,8 +64,26 @@ func (r *RtdtManager) LaunchTwin(twinSubnetIPv4, twinSubnetIPv6, twinName string
return nil
}
// Apply the changes from a twin back to realnet
func (r *RtdtManager) ApplyChanges(twinName string) error {
var twin *venv.VEnv
for _, tw := range r.rtdt_twins {
if tw.Name == twinName {
twin = tw
}
}
for _, change := range *twin.GetSavedChanges() {
mneid := change.Mneid
path := change.Path.String()
val := change.Value
//apiOp := change.ApiOp
r.realnet.SetGnmiPath(path, val.GetStringVal(), mneid, false)
}
return nil
}
// Performance benchmarks of realnet
func (r *RtdtManager) RunBenchmark() error {
func (r *RtdtManager) RunBenchmark0() error {
var mneid string
for _, node := range r.realnet.GetTopology().Nodes {
if strings.HasPrefix(node.Name, "gnmi-target-switch0") {
......
......@@ -39,7 +39,6 @@ type Topology struct {
}
func NewTopology() *Topology {
return &Topology{}
}
......
......@@ -341,3 +341,6 @@ func (v *VEnv) GetWaitgroup() *sync.WaitGroup {
func (v *VEnv) GetTopology() *rtdt_topology.Topology {
return &v.topology
}
func (v *VEnv) GetSavedChanges() *[]*networkelement.ChangeRequest {
return &v.savedChanges
}
system/config/hostname
system/config/domain-name
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment