Loading go-apps/meep-vis/sbi/vis-sbi.go +62 −63 Original line number Diff line number Diff line Loading @@ -18,9 +18,8 @@ package sbi import ( "sync" "time" // "time" dataModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model" gc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache" log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" Loading Loading @@ -62,7 +61,7 @@ type VisSbi struct { apiMgr *sam.SwaggerApiMgr activeModel *mod.Model gisCache *gc.GisCache refreshTicker *time.Ticker // refreshTicker *time.Ticker // updateStaInfoCB func(string, string, string, *int32, *int32, *int32) // updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateScenarioNameCB func(string) Loading Loading @@ -248,28 +247,28 @@ func processActiveScenarioTerminate() { sbi.cleanUpCB() } func getAppSumUlDl(apps []string) (float32, float32) { sumUl := 0.0 sumDl := 0.0 //var appNames []string for _, appName := range apps { //appNames = append(appNames, process.Name) if metricStore != nil { metricsArray, err := metricStore.GetCachedNetworkMetrics("*", appName) if err != nil { log.Error("Failed to get network metric:", err) } // func getAppSumUlDl(apps []string) (float32, float32) { // sumUl := 0.0 // sumDl := 0.0 // //var appNames []string // for _, appName := range apps { // //appNames = append(appNames, process.Name) // if metricStore != nil { // metricsArray, err := metricStore.GetCachedNetworkMetrics("*", appName) // if err != nil { // log.Error("Failed to get network metric:", err) // } //downlink for the app is uplink for the UE, and vice-versa for _, metrics := range metricsArray { sumUl += metrics.DlTput sumDl += metrics.UlTput } } } // //downlink for the app is uplink for the UE, and vice-versa // for _, metrics := range metricsArray { // sumUl += metrics.DlTput // sumDl += metrics.UlTput // } // } // } return float32(sumUl), float32(sumDl) } // return float32(sumUl), float32(sumDl) // } func processActiveScenarioUpdate() { Loading @@ -279,13 +278,13 @@ func processActiveScenarioUpdate() { log.Debug("processActiveScenarioUpdate") // Get previous list of connected UEs prevUeNames := []string{} prevUeNameList := sbi.activeModel.GetNodeNames("UE") for _, name := range prevUeNameList { if isUeConnected(name) && isInLocality(name) { prevUeNames = append(prevUeNames, name) } } // prevUeNames := []string{} // prevUeNameList := sbi.activeModel.GetNodeNames("UE") // for _, name := range prevUeNameList { // if isUeConnected(name) && isInLocality(name) { // prevUeNames = append(prevUeNames, name) // } // } sbi.activeModel.UpdateScenario() Loading Loading @@ -467,37 +466,37 @@ func processActiveScenarioUpdate() { // } // } func getRssi(ue string, poa string, ueMeasMap map[string]*gc.UeMeasurement) *int32 { if ueMeas, ueFound := ueMeasMap[ue]; ueFound { if meas, poaFound := ueMeas.Measurements[poa]; poaFound { rssi := int32(meas.Rssi) return &rssi } } return nil } // func getRssi(ue string, poa string, ueMeasMap map[string]*gc.UeMeasurement) *int32 { // if ueMeas, ueFound := ueMeasMap[ue]; ueFound { // if meas, poaFound := ueMeas.Measurements[poa]; poaFound { // rssi := int32(meas.Rssi) // return &rssi // } // } // return nil // } func isUeConnected(name string) bool { node := sbi.activeModel.GetNode(name) if node != nil { pl := node.(*dataModel.PhysicalLocation) if pl.Connected { return true } } return false } // func isUeConnected(name string) bool { // node := sbi.activeModel.GetNode(name) // if node != nil { // pl := node.(*dataModel.PhysicalLocation) // if pl.Connected { // return true // } // } // return false // } func isInLocality(name string) bool { if sbi.localityEnabled { ctx := sbi.activeModel.GetNodeContext(name) if ctx == nil { log.Error("Error getting context for: " + name) return false } if _, found := sbi.locality[ctx.Parents[mod.Zone]]; !found { return false } } return true } // func isInLocality(name string) bool { // if sbi.localityEnabled { // ctx := sbi.activeModel.GetNodeContext(name) // if ctx == nil { // log.Error("Error getting context for: " + name) // return false // } // if _, found := sbi.locality[ctx.Parents[mod.Zone]]; !found { // return false // } // } // return true // } go-apps/meep-vis/server/model_one_ofbody.go +4 −4 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ package server type OneOfbody struct { ProvChgUuUniSubscription ProvChgUuMbmsSubscription ProvChgPc5Subscription V2xMsgSubscription // ProvChgUuUniSubscription // ProvChgUuMbmsSubscription // ProvChgPc5Subscription // V2xMsgSubscription } go-apps/meep-vis/server/model_one_ofbody_1.go +4 −4 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ package server type OneOfbody1 struct { ProvChgUuUniSubscription ProvChgUuMbmsSubscription ProvChgPc5Subscription V2xMsgSubscription // ProvChgUuUniSubscription // ProvChgUuMbmsSubscription // ProvChgPc5Subscription // V2xMsgSubscription } Loading
go-apps/meep-vis/sbi/vis-sbi.go +62 −63 Original line number Diff line number Diff line Loading @@ -18,9 +18,8 @@ package sbi import ( "sync" "time" // "time" dataModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model" gc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache" log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger" met "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics" Loading Loading @@ -62,7 +61,7 @@ type VisSbi struct { apiMgr *sam.SwaggerApiMgr activeModel *mod.Model gisCache *gc.GisCache refreshTicker *time.Ticker // refreshTicker *time.Ticker // updateStaInfoCB func(string, string, string, *int32, *int32, *int32) // updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateScenarioNameCB func(string) Loading Loading @@ -248,28 +247,28 @@ func processActiveScenarioTerminate() { sbi.cleanUpCB() } func getAppSumUlDl(apps []string) (float32, float32) { sumUl := 0.0 sumDl := 0.0 //var appNames []string for _, appName := range apps { //appNames = append(appNames, process.Name) if metricStore != nil { metricsArray, err := metricStore.GetCachedNetworkMetrics("*", appName) if err != nil { log.Error("Failed to get network metric:", err) } // func getAppSumUlDl(apps []string) (float32, float32) { // sumUl := 0.0 // sumDl := 0.0 // //var appNames []string // for _, appName := range apps { // //appNames = append(appNames, process.Name) // if metricStore != nil { // metricsArray, err := metricStore.GetCachedNetworkMetrics("*", appName) // if err != nil { // log.Error("Failed to get network metric:", err) // } //downlink for the app is uplink for the UE, and vice-versa for _, metrics := range metricsArray { sumUl += metrics.DlTput sumDl += metrics.UlTput } } } // //downlink for the app is uplink for the UE, and vice-versa // for _, metrics := range metricsArray { // sumUl += metrics.DlTput // sumDl += metrics.UlTput // } // } // } return float32(sumUl), float32(sumDl) } // return float32(sumUl), float32(sumDl) // } func processActiveScenarioUpdate() { Loading @@ -279,13 +278,13 @@ func processActiveScenarioUpdate() { log.Debug("processActiveScenarioUpdate") // Get previous list of connected UEs prevUeNames := []string{} prevUeNameList := sbi.activeModel.GetNodeNames("UE") for _, name := range prevUeNameList { if isUeConnected(name) && isInLocality(name) { prevUeNames = append(prevUeNames, name) } } // prevUeNames := []string{} // prevUeNameList := sbi.activeModel.GetNodeNames("UE") // for _, name := range prevUeNameList { // if isUeConnected(name) && isInLocality(name) { // prevUeNames = append(prevUeNames, name) // } // } sbi.activeModel.UpdateScenario() Loading Loading @@ -467,37 +466,37 @@ func processActiveScenarioUpdate() { // } // } func getRssi(ue string, poa string, ueMeasMap map[string]*gc.UeMeasurement) *int32 { if ueMeas, ueFound := ueMeasMap[ue]; ueFound { if meas, poaFound := ueMeas.Measurements[poa]; poaFound { rssi := int32(meas.Rssi) return &rssi } } return nil } // func getRssi(ue string, poa string, ueMeasMap map[string]*gc.UeMeasurement) *int32 { // if ueMeas, ueFound := ueMeasMap[ue]; ueFound { // if meas, poaFound := ueMeas.Measurements[poa]; poaFound { // rssi := int32(meas.Rssi) // return &rssi // } // } // return nil // } func isUeConnected(name string) bool { node := sbi.activeModel.GetNode(name) if node != nil { pl := node.(*dataModel.PhysicalLocation) if pl.Connected { return true } } return false } // func isUeConnected(name string) bool { // node := sbi.activeModel.GetNode(name) // if node != nil { // pl := node.(*dataModel.PhysicalLocation) // if pl.Connected { // return true // } // } // return false // } func isInLocality(name string) bool { if sbi.localityEnabled { ctx := sbi.activeModel.GetNodeContext(name) if ctx == nil { log.Error("Error getting context for: " + name) return false } if _, found := sbi.locality[ctx.Parents[mod.Zone]]; !found { return false } } return true } // func isInLocality(name string) bool { // if sbi.localityEnabled { // ctx := sbi.activeModel.GetNodeContext(name) // if ctx == nil { // log.Error("Error getting context for: " + name) // return false // } // if _, found := sbi.locality[ctx.Parents[mod.Zone]]; !found { // return false // } // } // return true // }
go-apps/meep-vis/server/model_one_ofbody.go +4 −4 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ package server type OneOfbody struct { ProvChgUuUniSubscription ProvChgUuMbmsSubscription ProvChgPc5Subscription V2xMsgSubscription // ProvChgUuUniSubscription // ProvChgUuMbmsSubscription // ProvChgPc5Subscription // V2xMsgSubscription }
go-apps/meep-vis/server/model_one_ofbody_1.go +4 −4 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ package server type OneOfbody1 struct { ProvChgUuUniSubscription ProvChgUuMbmsSubscription ProvChgPc5Subscription V2xMsgSubscription // ProvChgUuUniSubscription // ProvChgUuMbmsSubscription // ProvChgPc5Subscription // V2xMsgSubscription }