Commit 0658a7a4 authored by Simon Pastor's avatar Simon Pastor
Browse files

grafana graph update

parent 0c958170
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -95,6 +95,8 @@ repo:
    dashboards:
      network-metrics-point-to-point: dashboards/network-metrics-point-to-point.json
      network-metrics-aggregation: dashboards/network-metrics-aggregation.json
      wireless-metrics-point-to-point: dashboards/wireless-metrics-point-to-point.json
      wireless-metrics-aggregation: dashboards/wireless-metrics-aggregation.json
      http-single-log: dashboards/http-log-byId.json
      http-logs-aggregation: dashboards/http-loggers.json
      platform-advantedge: dashboards/platform-advantedge.json
+39 −21
Original line number Diff line number Diff line
@@ -59,8 +59,7 @@
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 23,
  "iteration": 1621267088775,
  "iteration": 1621447328946,
  "links": [],
  "panels": [
    {
@@ -106,6 +105,8 @@
      "legend": {
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
@@ -115,7 +116,7 @@
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
@@ -149,7 +150,7 @@
          "measurement": "/^$scenario$/",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT rsrp FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest",
          "query": "SELECT mean(\"rsrp\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest, time(1s)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -186,7 +187,7 @@
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "RSRPs",
      "title": "RSRPs (4G / 5G)",
      "tooltip": {
        "shared": true,
        "sort": 0,
@@ -252,6 +253,7 @@
      "legend": {
        "avg": false,
        "current": false,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
@@ -261,7 +263,7 @@
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
@@ -295,7 +297,7 @@
          "measurement": "/^$scenario$/",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT rsrq FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest",
          "query": "SELECT mean(\"rsrq\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest, time(1s)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -332,7 +334,7 @@
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "RSRQs",
      "title": "RSRQs (4G / 5G)",
      "tooltip": {
        "shared": true,
        "sort": 0,
@@ -398,6 +400,7 @@
      "legend": {
        "avg": false,
        "current": false,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
@@ -407,7 +410,7 @@
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
@@ -441,7 +444,7 @@
          "measurement": "/^$scenario$/",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT rssi FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest",
          "query": "SELECT mean(\"rssi\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest, time(1s)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -478,7 +481,7 @@
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "RSSIs",
      "title": "RSSIs (WIFI)",
      "tooltip": {
        "shared": true,
        "sort": 0,
@@ -558,6 +561,7 @@
      "legend": {
        "avg": false,
        "current": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "show": true,
@@ -567,7 +571,7 @@
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
@@ -601,7 +605,7 @@
          "measurement": "/^$scenario$/",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT dist FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest",
          "query": "SELECT mean(\"dist\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/) AND $timeFilter GROUP BY dest, time(1s)",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -783,7 +787,7 @@
          "measurement": "events",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT type,description FROM $database.autogen.events WHERE $timeFilter ORDER BY time desc LIMIT 100",
          "query": "SELECT type,description FROM $database.autogen.events WHERE $timeFilter AND (\"src\" =~ /^$src$/) ORDER BY time desc LIMIT 100",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -797,7 +801,19 @@
              }
            ]
          ],
          "tags": []
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "timeFrom": null,
@@ -807,7 +823,7 @@
      "type": "table-old"
    }
  ],
  "refresh": "",
  "refresh": "1s",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
@@ -836,8 +852,8 @@
        "allValue": null,
        "current": {
          "selected": false,
          "text": "may14_4g_5g_wifi_macro",
          "value": "may14_4g_5g_wifi_macro"
          "text": "_internal",
          "value": "_internal"
        },
        "datasource": "$datasource",
        "definition": "show databases",
@@ -862,9 +878,10 @@
      {
        "allValue": null,
        "current": {
          "isNone": true,
          "selected": false,
          "text": "10.100.0.4",
          "value": "10.100.0.4"
          "text": "None",
          "value": ""
        },
        "datasource": "$datasource",
        "definition": "",
@@ -911,5 +928,6 @@
  "timezone": "",
  "title": "Wireless Metrics Aggregation",
  "uid": "6",
  "version": 4
  "version": 6
}
+43 −18
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 21,
  "iteration": 1621266422427,
  "iteration": 1621449565579,
  "links": [],
  "panels": [
    {
@@ -145,7 +144,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"dist\" FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter",
@@ -278,7 +277,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"rsrp\" FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter",
@@ -313,7 +312,7 @@
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "RSRP",
      "title": "RSRP (4G / 5G)",
      "type": "singlestat",
      "valueFontSize": "100%",
      "valueMaps": [
@@ -411,7 +410,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"rsrq\" FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter",
@@ -446,7 +445,7 @@
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "RSRQ",
      "title": "RSRQ (4G / 5G)",
      "type": "singlestat",
      "valueFontSize": "100%",
      "valueMaps": [
@@ -544,7 +543,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT \"rssi\" FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter",
@@ -579,7 +578,7 @@
      "thresholds": "",
      "timeFrom": null,
      "timeShift": null,
      "title": "RSSI",
      "title": "RSSI (WIFI)",
      "type": "singlestat",
      "valueFontSize": "100%",
      "valueMaps": [
@@ -620,6 +619,7 @@
      "legend": {
        "avg": false,
        "current": false,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
@@ -629,7 +629,7 @@
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "connected",
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
@@ -659,7 +659,7 @@
              "type": "fill"
            }
          ],
          "measurement": "/^$scenario$/",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT mean(\"rsrp\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter GROUP BY time(1s)",
@@ -710,7 +710,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT mean(\"rsrq\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter GROUP BY time(1s)",
@@ -761,7 +761,7 @@
              "type": "fill"
            }
          ],
          "measurement": "network",
          "measurement": "gis",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT mean(\"rssi\") FROM $database.autogen.gis WHERE (\"src\" =~ /^$src$/ AND \"dest\" =~ /^$dest$/) AND $timeFilter GROUP BY time(1s)",
@@ -832,7 +832,19 @@
              }
            ]
          ],
          "tags": []
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "thresholds": [],
@@ -962,7 +974,7 @@
          "measurement": "events",
          "orderByTime": "ASC",
          "policy": "default",
          "query": "SELECT type,description FROM $database.autogen.events WHERE $timeFilter ORDER BY time desc LIMIT 100",
          "query": "SELECT type,description FROM $database.autogen.events WHERE (\"src\" =~ /^$src$/ AND (\"dest\" =~ /^$dest$/ OR \"dest\" = \'\')) AND $timeFilter ORDER BY time desc LIMIT 100",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "time_series",
@@ -976,7 +988,19 @@
              }
            ]
          ],
          "tags": []
          "tags": [
            {
              "key": "src",
              "operator": "=~",
              "value": "/^$src$/"
            },
            {
              "condition": "AND",
              "key": "dest",
              "operator": "=~",
              "value": "/^$dest$/"
            }
          ]
        }
      ],
      "timeFrom": null,
@@ -986,7 +1010,7 @@
      "type": "table-old"
    }
  ],
  "refresh": "5s",
  "refresh": "1s",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
@@ -1119,5 +1143,6 @@
  "timezone": "",
  "title": "Wireless Metrics Point-to-Point",
  "uid": "5",
  "version": 6
  "version": 7
}
+13 −1
Original line number Diff line number Diff line
@@ -788,14 +788,24 @@ func ceSendEvent(w http.ResponseWriter, r *http.Request) {

	// Process Event
	var httpStatus int
	var description string
	var description, src, dest string
	switch eventType {
	case eventTypeMobility:
		err, httpStatus, description = sendEventMobility(event)
		if err == nil {
			src = event.EventMobility.ElementName
			dest = event.EventMobility.Dest
		}
	case eventTypeNetCharUpdate:
		err, httpStatus, description = sendEventNetworkCharacteristics(event)
		if err == nil {
			src = event.EventNetworkCharacteristicsUpdate.ElementName
		}
	case eventTypePoasInRange:
		err, httpStatus, description = sendEventPoasInRange(event)
		if err == nil {
			src = event.EventPoasInRange.Ue
		}
	case eventTypeScenarioUpdate:
		err, httpStatus, description = sendEventScenarioUpdate(event)
	case eventTypePduSession:
@@ -817,6 +827,8 @@ func ceSendEvent(w http.ResponseWriter, r *http.Request) {
		var metric met.EventMetric
		metric.Event = string(eventJSONStr)
		metric.Description = description
		metric.Src = src
		metric.Dest = dest
		err = sbxCtrl.metricStore.SetEventMetric(eventType, metric)
	}
	if err != nil {
+15 −1
Original line number Diff line number Diff line
@@ -26,11 +26,15 @@ const EvMetName = "events"
const EvMetType = "type"
const EvMetEvent = "event"
const EvMetDescription = "description"
const EvMetSrc = "src"
const EvMetDest = "dest"

type EventMetric struct {
	Time        interface{}
	Event       string
	Description string
	Src         string
	Dest        string
}

// SetEventMetric
@@ -38,7 +42,11 @@ func (ms *MetricStore) SetEventMetric(eventType string, em EventMetric) error {
	metricList := make([]Metric, 1)
	metric := &metricList[0]
	metric.Name = EvMetName
	metric.Tags = map[string]string{EvMetType: eventType}
	metric.Tags = map[string]string{
		EvMetType: eventType,
		EvMetSrc:  em.Src,
		EvMetDest: em.Dest,
	}
	metric.Fields = map[string]interface{}{
		EvMetEvent:       em.Event,
		EvMetDescription: em.Description,
@@ -78,6 +86,12 @@ func (ms *MetricStore) GetEventMetric(eventType string, duration string, count i
		if val, ok := values[EvMetDescription].(string); ok {
			metrics[index].Description = val
		}
		if val, ok := values[EvMetSrc].(string); ok {
			metrics[index].Src = val
		}
		if val, ok := values[EvMetDest].(string); ok {
			metrics[index].Dest = val
		}
	}
	return
}