X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fusecases%2Fodusliceassurance%2Fgoversion%2Finternal%2Fstructures%2Fsliceassurance.go;h=d7c25569ae9baef83abe36bda8c4c54f456be4ee;hb=df5eeb6e3fe42f87ac399f624edef20c87d1e475;hp=7cefcaf6c0196a37c66924c8b80e5161acdb0fe6;hpb=d50e9da2396b3cb21af4018495e6a39705b2f53a;p=nonrtric.git diff --git a/test/usecases/odusliceassurance/goversion/internal/structures/sliceassurance.go b/test/usecases/odusliceassurance/goversion/internal/structures/sliceassurance.go index 7cefcaf6..d7c25569 100644 --- a/test/usecases/odusliceassurance/goversion/internal/structures/sliceassurance.go +++ b/test/usecases/odusliceassurance/goversion/internal/structures/sliceassurance.go @@ -25,6 +25,7 @@ import ( "regexp" "strconv" + log "github.com/sirupsen/logrus" "oransc.org/usecase/oduclosedloop/messages" ) @@ -51,8 +52,13 @@ func (sa *SliceAssuranceMeas) AddNewPolicy(duid string, rrmPolicyRatio messages. metric := sa.GetSliceMetric(duid, policyMember.SliceDifferentiator, policyMember.SliceServiceType) if metric != nil { pr := NewPolicyRatio(rrmPolicyRatio.Id, rrmPolicyRatio.RRMPolicyMaxRatio, rrmPolicyRatio.RRMPolicyMinRatio, rrmPolicyRatio.RRMPolicyDedicatedRatio) + _, check := sa.Policies[pr.PolicyRatioId] + if !check { + log.Infof(" new policy has been added %+v", *pr) + } sa.Policies[pr.PolicyRatioId] = pr metric.RRMPolicyRatioId = rrmPolicyRatio.Id + } } } @@ -102,14 +108,17 @@ func (sa *SliceAssuranceMeas) addMetric(res [][]string, metricValue int) { metric.PM[res[0][3]] = metricValue key := MapKey{res[0][2], toInt(res[0][5]), toInt(res[0][6])} sa.Metrics[key] = metric + log.Infof(" new metric has been added %+v", *metric) } } func (sa *SliceAssuranceMeas) updateMetric(key MapKey, value *SliceMetric, metricName string, metricValue int) { if metricValue < 700 { delete(sa.Metrics, key) + log.Infof(" metric with key %+v has been deleted", key) } else { value.PM[metricName] = metricValue + log.Infof(" metric value has been updated, new value: %v", metricValue) } }