+ return duid, fmt.Errorf(" wrong format for MeasurementTypeInstanceReference")
+ }
+ return duid, nil
+}
+
+func (sa *SliceAssuranceMeas) addMetric(res [][]string, metricValue int) {
+ if metricValue > 700 {
+ metric := NewSliceMetric(res[0][1], res[0][2], toInt(res[0][4]), toInt(res[0][5]))
+ metric.PM[res[0][3]] = metricValue
+ key := MapKey{res[0][1], toInt(res[0][4]), toInt(res[0][5])}
+ sa.Metrics[key] = metric
+ }
+}
+
+func (sa *SliceAssuranceMeas) updateMetric(key MapKey, value *SliceMetric, metricName string, metricValue int) {
+ if metricValue < 700 {
+ delete(sa.Metrics, key)
+ } else {
+ value.PM[metricName] = metricValue
+ }
+}
+
+func toInt(num string) int {
+ res, err := strconv.Atoi(num)
+ if err != nil {
+ return -1
+ }
+ return res
+}
+
+func (sa *SliceAssuranceMeas) PrintStructures() {
+ fmt.Printf("SliceAssurance Metrics: \n")
+ for key, metric := range sa.Metrics {
+ fmt.Printf("Key: %+v\n", key)
+ fmt.Printf("Metric: %+v\n", metric)
+ }
+ fmt.Printf("SliceAssurance Policies: \n")
+ for key, metric := range sa.Policies {
+ fmt.Printf("Key: %+v\n", key)
+ fmt.Printf("Metric: %+v\n", metric)