aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijit Sinha <abhijit.sinha@intel.com>2018-11-28 13:13:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-11-28 13:13:25 +0000
commitb3ca56a2ef70cbb44fd36d7a8bbfab945a4fb96c (patch)
tree8116e7d3b23a2276c8b2ffa7ee3999c2b67d8621
parenteedf287dbef58ada1cfe299eae87067c03f390b4 (diff)
parentbf507da25ad1e6adc6a5c162a4d0de325baef888 (diff)
Merge "NSB NFVi PROX Should report realtime port activity not historical data"
-rw-r--r--dashboard/Prox_BM_L3FWD-4Port-1539358774395.json (renamed from dashboard/Prox_BM_L3FWD-4Port-1536065939744.json)796
-rw-r--r--yardstick/network_services/traffic_profile/prox_binsearch.py4
-rw-r--r--yardstick/network_services/vnf_generic/vnf/prox_helpers.py124
-rw-r--r--yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py11
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py154
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py20
6 files changed, 1004 insertions, 105 deletions
diff --git a/dashboard/Prox_BM_L3FWD-4Port-1536065939744.json b/dashboard/Prox_BM_L3FWD-4Port-1539358774395.json
index 63b8f4f12..304290560 100644
--- a/dashboard/Prox_BM_L3FWD-4Port-1536065939744.json
+++ b/dashboard/Prox_BM_L3FWD-4Port-1539358774395.json
@@ -14,7 +14,7 @@
"type": "grafana",
"id": "grafana",
"name": "Grafana",
- "version": "4.6.3"
+ "version": "4.4.3"
},
{
"type": "panel",
@@ -60,7 +60,7 @@
"hideControls": false,
"id": null,
"links": [],
- "refresh": false,
+ "refresh": "5s",
"rows": [
{
"collapse": false,
@@ -547,7 +547,8 @@
"max": true,
"min": true,
"show": true,
- "sortDesc": true,
+ "sort": null,
+ "sortDesc": null,
"total": false,
"values": true
},
@@ -855,7 +856,7 @@
],
"timeFrom": null,
"timeShift": null,
- "title": "Generator stats",
+ "title": "Generator Stats: Average Throughout per step",
"tooltip": {
"msResolution": true,
"shared": true,
@@ -1040,6 +1041,558 @@
"error": false,
"fill": 1,
"grid": {},
+ "height": "300px",
+ "id": 206,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": false,
+ "max": true,
+ "min": true,
+ "show": true,
+ "sortDesc": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 6,
+ "stack": false,
+ "steppedLine": true,
+ "targets": [
+ {
+ "alias": "TG xe-0 Out packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.xe0.out_packets\") / 1000000 FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe0.out_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-1 Out packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.live_stats.xe1.out_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "B",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe1.out_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-2 Out packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "hide": false,
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.xe2.out_packets\") / 1000000 FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "C",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe2.out_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-3 Out packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.xe3.out_packets\") / 1000000 FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "D",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe3.out_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "thresholds": [
+ {
+ "colorMode": "custom",
+ "fill": true,
+ "fillColor": "rgba(216, 200, 27, 0.27)",
+ "op": "gt",
+ "value": 0
+ },
+ {
+ "colorMode": "custom",
+ "fill": true,
+ "fillColor": "rgba(234, 112, 112, 0.22)",
+ "op": "gt",
+ "value": 0
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Packets Sent by Generator per second and per interface",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "Million Packets Per Second",
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "${DS_YARDSTICK}",
+ "decimals": 4,
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
+ "height": "300px",
+ "id": 207,
+ "legend": {
+ "alignAsTable": true,
+ "avg": true,
+ "current": false,
+ "max": true,
+ "min": true,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "connected",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "alias": "TG xe-0 in packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.xe0.in_packets\") / 1000000 FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "A",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe0.in_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-1 in packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.live_stats.xe1.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "B",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe1.in_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-2 in packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.live_stats.xe2.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "C",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe2.in_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ },
+ {
+ "alias": "TG xe-3 in packets",
+ "dsType": "influxdb",
+ "groupBy": [
+ {
+ "params": [
+ "$interval"
+ ],
+ "type": "time"
+ },
+ {
+ "params": [
+ "null"
+ ],
+ "type": "fill"
+ }
+ ],
+ "measurement": "tc_prox_baremetal_l3fwd-4",
+ "orderByTime": "ASC",
+ "policy": "default",
+ "query": "SELECT mean(\"tg__0.collect_stats.live_stats.xe3.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
+ "rawQuery": false,
+ "refId": "D",
+ "resultFormat": "time_series",
+ "select": [
+ [
+ {
+ "params": [
+ "tg__0.collect_stats.live_stats.xe3.in_packets"
+ ],
+ "type": "field"
+ },
+ {
+ "params": [],
+ "type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
+ }
+ ]
+ ],
+ "tags": []
+ }
+ ],
+ "thresholds": [
+ {
+ "colorMode": "custom",
+ "fill": true,
+ "fillColor": "rgba(216, 200, 27, 0.27)",
+ "op": "gt",
+ "value": 0
+ },
+ {
+ "colorMode": "custom",
+ "fill": true,
+ "fillColor": "rgba(234, 112, 112, 0.22)",
+ "op": "gt",
+ "value": 0
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Packets Received by Generator per second and per interface",
+ "tooltip": {
+ "msResolution": true,
+ "shared": true,
+ "sort": 0,
+ "value_type": "cumulative"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "Million Packets Per Second",
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "${DS_YARDSTICK}",
+ "decimals": 4,
+ "editable": true,
+ "error": false,
+ "fill": 1,
+ "grid": {},
"height": "300",
"id": 4,
"legend": {
@@ -1050,7 +1603,7 @@
"min": true,
"rightSide": false,
"show": true,
- "sortDesc": true,
+ "sortDesc": false,
"total": false,
"values": true
},
@@ -1295,7 +1848,7 @@
]
},
{
- "content": "<h5 style=\"font-family:Verdana\"> <a style=\"color:#31A7D3\"><a style=\"font: 22px '#31A7D3'\"><center>Prox L3Fwd Traffic Gen stats</center> </a></h5>\n",
+ "content": "<h5 style=\"font-family:Verdana\"> <a style=\"color:#31A7D3\"><a style=\"font: 22px '#31A7D3'\"><center>Generator Stats: Packets per Step</center> </a></h5>\n",
"editable": true,
"error": false,
"height": "40",
@@ -1362,11 +1915,12 @@
"type": "fill"
}
],
+ "hide": false,
"measurement": "tc_prox_baremetal_l3fwd-4",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe0.out_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
@@ -1380,6 +1934,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1402,11 +1962,12 @@
"type": "fill"
}
],
+ "hide": false,
"measurement": "tc_prox_baremetal_l3fwd-4",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe1.out_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "B",
"resultFormat": "time_series",
"select": [
@@ -1420,6 +1981,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1442,11 +2009,12 @@
"type": "fill"
}
],
+ "hide": false,
"measurement": "tc_prox_baremetal_l3fwd-4",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe2.out_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "C",
"resultFormat": "time_series",
"select": [
@@ -1460,6 +2028,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1486,7 +2060,7 @@
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe3.out_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "D",
"resultFormat": "time_series",
"select": [
@@ -1500,6 +2074,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1524,7 +2104,7 @@
],
"timeFrom": null,
"timeShift": null,
- "title": "Packets Sent by Generator",
+ "title": "Packets Sent by Generator per Step",
"tooltip": {
"msResolution": true,
"shared": true,
@@ -1542,7 +2122,7 @@
"yaxes": [
{
"format": "short",
- "label": "Packets ",
+ "label": "Million Packets Per Step",
"logBase": 1,
"max": null,
"min": "0",
@@ -1564,6 +2144,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_YARDSTICK}",
+ "decimals": 4,
"editable": true,
"error": false,
"fill": 1,
@@ -1577,6 +2158,7 @@
"max": true,
"min": true,
"show": true,
+ "sortDesc": true,
"total": false,
"values": true
},
@@ -1615,7 +2197,7 @@
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe0.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
"select": [
@@ -1629,6 +2211,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1655,7 +2243,7 @@
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe1.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "B",
"resultFormat": "time_series",
"select": [
@@ -1669,6 +2257,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1695,7 +2289,7 @@
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe2.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "C",
"resultFormat": "time_series",
"select": [
@@ -1709,6 +2303,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1735,7 +2335,7 @@
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT mean(\"tg__0.collect_stats.xe3.in_packets\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE $timeFilter GROUP BY time($interval) fill(null)",
- "rawQuery": true,
+ "rawQuery": false,
"refId": "D",
"resultFormat": "time_series",
"select": [
@@ -1749,6 +2349,12 @@
{
"params": [],
"type": "mean"
+ },
+ {
+ "params": [
+ " / 1000000"
+ ],
+ "type": "math"
}
]
],
@@ -1773,7 +2379,7 @@
],
"timeFrom": null,
"timeShift": null,
- "title": "Packets Received by Generator",
+ "title": "Packets Received by Generator per Step",
"tooltip": {
"msResolution": true,
"shared": true,
@@ -1791,7 +2397,7 @@
"yaxes": [
{
"format": "short",
- "label": "Packets Per Second",
+ "label": "Million Packets Per Step",
"logBase": 1,
"max": null,
"min": "0",
@@ -2470,7 +3076,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -2558,7 +3164,7 @@
"measurement": "tc_prox_baremetal_l3fwd-4",
"orderByTime": "ASC",
"policy": "default",
- "query": "SELECT last(\"tg__0.collect_stats.theor_max_throughput\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE \"tg__0.collect_stats.PktSize\" = 64 AND \"tg__0.collect_stats.Status\" = 'Result' AND $timeFilter GROUP BY time($__interval) fill(null)",
+ "query": "SELECT last(\"tg__0.collect_stats.theor_max_throughput\") FROM \"tc_prox_baremetal_l3fwd-4\" WHERE \"tg__0.collect_stats.PktSize\" = 64 AND \"tg__0.collect_stats.Status\" = 'Result' AND $timeFilter GROUP BY time($__interval) fill(null)",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
@@ -2566,7 +3172,7 @@
[
{
"params": [
- "tg__0.collect_stats.theor_max_throughput"
+ "tg__0.collect_stats.RequestedTxThroughput"
],
"type": "field"
},
@@ -2588,7 +3194,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -2701,7 +3307,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -2819,7 +3425,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -2936,7 +3542,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3053,7 +3659,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3170,7 +3776,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3287,7 +3893,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3405,7 +4011,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3540,7 +4146,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3658,7 +4264,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3771,7 +4377,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -3889,7 +4495,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4006,7 +4612,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4123,7 +4729,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4240,7 +4846,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4357,7 +4963,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4475,7 +5081,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4610,7 +5216,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4728,7 +5334,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4841,7 +5447,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -4959,7 +5565,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5076,7 +5682,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5193,7 +5799,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5310,7 +5916,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5427,7 +6033,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5545,7 +6151,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5680,7 +6286,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5798,7 +6404,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -5911,7 +6517,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6029,7 +6635,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6146,7 +6752,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6263,7 +6869,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6380,7 +6986,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6497,7 +7103,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6615,7 +7221,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6750,7 +7356,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6868,7 +7474,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -6981,7 +7587,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7099,7 +7705,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7216,7 +7822,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7333,7 +7939,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7450,7 +8056,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7567,7 +8173,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7685,7 +8291,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7820,7 +8426,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -7938,7 +8544,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8051,7 +8657,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8169,7 +8775,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8286,7 +8892,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8403,7 +9009,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8520,7 +9126,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8637,7 +9243,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8755,7 +9361,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -8890,7 +9496,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9008,7 +9614,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9121,7 +9727,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9239,7 +9845,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9356,7 +9962,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9473,7 +10079,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9590,7 +10196,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9707,7 +10313,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9825,7 +10431,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -9960,7 +10566,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10078,7 +10684,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10191,7 +10797,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10309,7 +10915,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10426,7 +11032,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10543,7 +11149,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10660,7 +11266,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10777,7 +11383,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -10895,7 +11501,7 @@
"thresholds": "",
"title": "",
"type": "singlestat",
- "valueFontSize": "50%",
+ "valueFontSize": "30%",
"valueMaps": [
{
"op": "=",
@@ -12457,8 +13063,8 @@
"list": []
},
"time": {
- "from": "2018-09-04T00:52:16.948Z",
- "to": "2018-09-04T12:52:16.948Z"
+ "from": "now-3h",
+ "to": "now"
},
"timepicker": {
"refresh_intervals": [
@@ -12487,5 +13093,5 @@
},
"timezone": "browser",
"title": "Prox_BM_L3FWD-4Port",
- "version": 3
+ "version": 6
} \ No newline at end of file
diff --git a/yardstick/network_services/traffic_profile/prox_binsearch.py b/yardstick/network_services/traffic_profile/prox_binsearch.py
index f924cf419..402bf741c 100644
--- a/yardstick/network_services/traffic_profile/prox_binsearch.py
+++ b/yardstick/network_services/traffic_profile/prox_binsearch.py
@@ -168,8 +168,8 @@ class ProxBinSearchProfile(ProxProfile):
samples = result.get_samples(pkt_size, successful_pkt_loss, port_samples)
- if theor_max_thruput < samples["TxThroughput"]:
- theor_max_thruput = samples['TxThroughput']
+ if theor_max_thruput < samples["RequestedTxThroughput"]:
+ theor_max_thruput = samples['RequestedTxThroughput']
samples['theor_max_throughput'] = theor_max_thruput
samples["rx_total"] = int(result.rx_total)
diff --git a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
index 8d721c045..e9d83623b 100644
--- a/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
+++ b/yardstick/network_services/vnf_generic/vnf/prox_helpers.py
@@ -601,6 +601,99 @@ class ProxSocketHelper(object):
LOG.debug("Multi port packet ..OK.. %s", tot_result)
return True, tot_result
+ @staticmethod
+ def multi_port_stats_tuple(stats, ports):
+ """
+ Create a statistics tuple from port stats.
+
+ Returns a dict with contains the port stats indexed by port name
+
+ :param stats: (List) - List of List of port stats in pps
+ :param ports (Iterator) - to List of Ports
+
+ :return: (Dict) of port stats indexed by port_name
+ """
+
+ samples = {}
+ port_names = {}
+ try:
+ port_names = {port_num: port_name for port_name, port_num in ports}
+ except (TypeError, IndexError, KeyError):
+ LOG.critical("Ports are not initialized or number of port is ZERO ... CRITICAL ERROR")
+ return {}
+
+ try:
+ for stat in stats:
+ port_num = stat[0]
+ samples[port_names[port_num]] = {
+ "in_packets": stat[1],
+ "out_packets": stat[2]}
+ except (TypeError, IndexError, KeyError):
+ LOG.error("Ports data and samples data is incompatable ....")
+ return {}
+
+ return samples
+
+ @staticmethod
+ def multi_port_stats_diff(prev_stats, new_stats, hz):
+ """
+ Create a statistics tuple from difference between prev port stats
+ and current port stats. And store results in pps.
+
+ :param prev_stats: (List) - Previous List of port statistics
+ :param new_stats: (List) - Current List of port statistics
+ :param hz (float) - speed of system in Hz
+
+ :return: sample (List) - Difference of prev_port_stats and
+ new_port_stats in pps
+ """
+
+ RX_TOTAL_INDEX = 1
+ TX_TOTAL_INDEX = 2
+ TSC_INDEX = 5
+
+ stats = []
+
+ if len(prev_stats) is not len(new_stats):
+ for port_index, stat in enumerate(new_stats):
+ stats.append([port_index, float(0), float(0), 0, 0, 0])
+ return stats
+
+ try:
+ for port_index, stat in enumerate(new_stats):
+ if stat[RX_TOTAL_INDEX] > prev_stats[port_index][RX_TOTAL_INDEX]:
+ rx_total = stat[RX_TOTAL_INDEX] - \
+ prev_stats[port_index][RX_TOTAL_INDEX]
+ else:
+ rx_total = stat[RX_TOTAL_INDEX]
+
+ if stat[TX_TOTAL_INDEX] > prev_stats[port_index][TX_TOTAL_INDEX]:
+ tx_total = stat[TX_TOTAL_INDEX] - prev_stats[port_index][TX_TOTAL_INDEX]
+ else:
+ tx_total = stat[TX_TOTAL_INDEX]
+
+ if stat[TSC_INDEX] > prev_stats[port_index][TSC_INDEX]:
+ tsc = stat[TSC_INDEX] - prev_stats[port_index][TSC_INDEX]
+ else:
+ tsc = stat[TSC_INDEX]
+
+ if tsc is 0:
+ rx_total = tx_total = float(0)
+ else:
+ if hz is 0:
+ LOG.error("HZ is ZERO ..")
+ rx_total = tx_total = float(0)
+ else:
+ rx_total = float(rx_total * hz / tsc)
+ tx_total = float(tx_total * hz / tsc)
+
+ stats.append([port_index, rx_total, tx_total, 0, 0, tsc])
+ except (TypeError, IndexError, KeyError):
+ stats = []
+ LOG.info("Current Port Stats incompatable to previous Port stats .. Discarded")
+
+ return stats
+
def port_stats(self, ports):
"""get counter values from a specific port"""
tot_result = [0] * 12
@@ -968,6 +1061,8 @@ class ProxResourceHelper(ClientResourceHelper):
self.step_delta = 1
self.step_time = 0.5
self._test_type = None
+ self.prev_multi_port = []
+ self.prev_hz = 0
@property
def sut(self):
@@ -1006,11 +1101,40 @@ class ProxResourceHelper(ClientResourceHelper):
def collect_collectd_kpi(self):
return self._collect_resource_kpi()
+ def collect_live_stats(self):
+ ports = []
+ for _, port_num in self.vnfd_helper.ports_iter():
+ ports.append(port_num)
+
+ ok, curr_port_stats = self.sut.multi_port_stats(ports)
+ if not ok:
+ return False, {}
+
+ hz = self.sut.hz()
+ if hz is 0:
+ hz = self.prev_hz
+ else:
+ self.prev_hz = hz
+
+ new_all_port_stats = \
+ self.sut.multi_port_stats_diff(self.prev_multi_port, curr_port_stats, hz)
+
+ self.prev_multi_port = curr_port_stats
+
+ live_stats = self.sut.multi_port_stats_tuple(new_all_port_stats,
+ self.vnfd_helper.ports_iter())
+ return True, live_stats
+
def collect_kpi(self):
result = super(ProxResourceHelper, self).collect_kpi()
# add in collectd kpis manually
if result:
result['collect_stats'] = self._collect_resource_kpi()
+
+ ok, live_stats = self.collect_live_stats()
+ if ok:
+ result.update({'live_stats': live_stats})
+
return result
def terminate(self):
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py b/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
index 4524eb7e6..f17656328 100644
--- a/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
+++ b/yardstick/tests/unit/network_services/traffic_profile/test_prox_binsearch.py
@@ -21,6 +21,8 @@ from yardstick.network_services.traffic_profile import prox_binsearch
class TestProxBinSearchProfile(unittest.TestCase):
+ THEOR_MAX_THROUGHPUT = 0.00012340000000000002
+
def setUp(self):
self._mock_log_info = mock.patch.object(prox_binsearch.LOG, 'info')
self.mock_log_info = self._mock_log_info.start()
@@ -80,7 +82,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
# Result Samples inc theor_max
result_tuple = {'Actual_throughput': 5e-07,
- 'theor_max_throughput': 7.5e-07,
+ 'theor_max_throughput': self.THEOR_MAX_THROUGHPUT,
'PktSize': 200,
'Status': 'Result'}
@@ -96,7 +98,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
"PktSize": 200,
"RxThroughput": 7.5e-07,
"Throughput": 7.5e-07,
- "TxThroughput": 0.00012340000000000002,
+ "TxThroughput": self.THEOR_MAX_THROUGHPUT,
"Status": 'Success'}
calls = profile.queue.put(success_result_tuple)
@@ -222,6 +224,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
raise RuntimeError(' '.join([str(args), str(runs)]))
if args[2] > 75.0:
return fail_tuple, {}
+
return success_tuple, {}
tp_config = {
@@ -258,7 +261,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
# Result Samples inc theor_max
result_tuple = {'Actual_throughput': 5e-07,
- 'theor_max_throughput': 7.5e-07,
+ 'theor_max_throughput': self.THEOR_MAX_THROUGHPUT,
'PktSize': 200,
"Status": 'Result'}
@@ -274,7 +277,7 @@ class TestProxBinSearchProfile(unittest.TestCase):
"PktSize": 200,
"RxThroughput": 7.5e-07,
"Throughput": 7.5e-07,
- "TxThroughput": 0.00012340000000000002,
+ "TxThroughput": self.THEOR_MAX_THROUGHPUT,
"Status": 'Success'}
calls = profile.queue.put(success_result_tuple)
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
index 894b16e13..6d1d8c6a1 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
@@ -648,6 +648,82 @@ class TestProxSocketHelper(unittest.TestCase):
self.assertListEqual(result, expected)
self.assertTrue(ok)
+ @mock.patch.object(prox_helpers.LOG, 'error')
+ def test_multi_port_stats_diff(self, *args):
+ mock_socket = mock.MagicMock()
+ prox = prox_helpers.ProxSocketHelper(mock_socket)
+ prox.get_string = mock.MagicMock(return_value=(True, '0,1,2,3,4,5;1,1,2,3,4,5'))
+ _, t1 = prox.multi_port_stats([0, 1])
+
+ prox.get_string = mock.MagicMock(return_value=(True, '0,2,4,6,8,6;1,4,8,16,32,6'))
+ _, t2 = prox.multi_port_stats([0, 1])
+
+ prox.get_string = mock.MagicMock(return_value=(True, '0,1,1,1,1,1;1,1,1,1,1,1'))
+ _, t3 = prox.multi_port_stats([0, 1])
+
+ prox.get_string = mock.MagicMock(return_value=(True, '0,2,2,2,2,2;1,2,2,2,2,2'))
+ _, t4 = prox.multi_port_stats([0, 1])
+
+ expected = [[0, 1.0, 2.0, 0, 0, 1], [1, 3.0, 6.0, 0, 0, 1]]
+ result = prox.multi_port_stats_diff(t1, t2, 1)
+
+ self.assertListEqual(result, expected)
+
+ result = prox.multi_port_stats_diff(t4, t3, 1)
+ expected = [[0, 1.0, 1.0, 0, 0, 1], [1, 1.0, 1.0, 0, 0, 1]]
+
+ self.assertListEqual(result, expected)
+
+ prox.get_string = mock.MagicMock(return_value=(True, '0,2,4,6,8,10'))
+ ok, t5 = prox.multi_port_stats([0, 1])
+ self.assertFalse(ok)
+ self.assertListEqual(t5, [])
+
+ result = prox.multi_port_stats_diff(t5, t4, 1)
+ expected = [[0, 0.0, 0.0, 0, 0, 0], [1, 0.0, 0.0, 0, 0, 0]]
+ self.assertListEqual(result, expected)
+
+ prox.get_string = mock.MagicMock(return_value=(True, '0,10,10,20,30,0;1,30,40,50,60,0'))
+ _, t6 = prox.multi_port_stats([0, 1])
+
+ prox.get_string = \
+ mock.MagicMock(return_value=(True, '0,100,100,100,100,0;1,100,100,100,100,0'))
+ _, t7 = prox.multi_port_stats([0, 1])
+
+ result = prox.multi_port_stats_diff(t6, t7, 1)
+ expected = [[0, 0.0, 0.0, 0, 0, 0], [1, 0.0, 0.0, 0, 0, 0]]
+ self.assertListEqual(result, expected)
+
+ result = prox.multi_port_stats_diff(t1, t2, 0)
+ expected = [[0, 0.0, 0.0, 0, 0, 1], [1, 0.0, 0.0, 0, 0, 1]]
+ self.assertListEqual(result, expected)
+
+ @mock.patch.object(prox_helpers.LOG, 'error')
+ def test_multi_port_stats_tuple(self, *args):
+ mock_socket = mock.MagicMock()
+ prox = prox_helpers.ProxSocketHelper(mock_socket)
+ prox.get_string = mock.MagicMock(return_value=(True, '0,1,2,3,4,5;1,1,2,3,4,5'))
+ _, result1 = prox.multi_port_stats([0, 1])
+ prox.get_string = mock.MagicMock(return_value=(True, '0,2,4,6,8,6;1,4,8,16,32,6'))
+ _, result2 = prox.multi_port_stats([0, 1])
+
+ result = prox.multi_port_stats_diff(result1, result2, 1)
+
+ vnfd_helper = mock.MagicMock()
+ vnfd_helper.ports_iter.return_value = [('xe0', 0), ('xe1', 1)]
+
+ expected = {'xe0': {'in_packets': 1.0, 'out_packets': 2.0},
+ 'xe1': {'in_packets': 3.0, 'out_packets': 6.0}}
+ live_stats = prox.multi_port_stats_tuple(result, vnfd_helper.ports_iter())
+ self.assertDictEqual(live_stats, expected)
+
+ live_stats = prox.multi_port_stats_tuple(result, None)
+ expected = {}
+ self.assertDictEqual(live_stats, expected)
+
+ live_stats = prox.multi_port_stats_tuple(None, vnfd_helper.ports_iter())
+ self.assertDictEqual(live_stats, expected)
+
def test_port_stats(self):
port_stats = [
','.join(str(n) for n in range(3, 15)),
@@ -1568,8 +1644,83 @@ class TestProxResourceHelper(unittest.TestCase):
helper = prox_helpers.ProxResourceHelper(mock.MagicMock())
helper._queue = queue = mock.MagicMock()
helper._result = {'z': 123}
+
+ helper.client = mock.MagicMock()
+ helper.client.hz.return_value = 1
+ helper.client.multi_port_stats.return_value = \
+ (True, [[0, 1, 2, 3, 4, 5], [1, 1, 2, 3, 4, 5]])
+ helper.client.multi_port_stats_diff.return_value = \
+ ([0, 1, 2, 3, 4, 5, 6, 7])
+ helper.client.multi_port_stats_tuple.return_value = \
+ {"xe0": {"in_packets": 1, "out_packets": 2}}
+ helper.resource = resource = mock.MagicMock()
+
+ vnfd_helper = mock.MagicMock()
+ vnfd_helper.ports_iter.return_value = [('xe0', 0), ('xe1', 1)]
+ helper.vnfd_helper = vnfd_helper
+
+ resource.check_if_system_agent_running.return_value = 0, '1234'
+ resource.amqp_collect_nfvi_kpi.return_value = 543
+ resource.check_if_system_agent_running.return_value = (0, None)
+
+ queue.empty.return_value = False
+ queue.get.return_value = {'a': 789}
+
+ expected = {'z': 123, 'a': 789,
+ 'collect_stats': {'core': 543},
+ 'live_stats': {'xe0': {'in_packets': 1, 'out_packets': 2}}}
+ result = helper.collect_kpi()
+ self.assertDictEqual(result, expected)
+
+ def test_collect_kpi_no_hz(self):
+ helper = prox_helpers.ProxResourceHelper(mock.MagicMock())
+ helper._queue = queue = mock.MagicMock()
+ helper._result = {'z': 123}
+
+ helper.client = mock.MagicMock()
+ helper.client.multi_port_stats.return_value = \
+ (True, [[0, 1, 2, 3, 4, 5], [1, 1, 2, 3, 4, 5]])
+ helper.client.multi_port_stats_diff.return_value = \
+ ([0, 1, 2, 3, 4, 5, 6, 7])
+ helper.client.multi_port_stats_tuple.return_value = \
+ {"xe0": {"in_packets": 1, "out_packets": 2}}
+ helper.resource = resource = mock.MagicMock()
+
+ vnfd_helper = mock.MagicMock()
+ vnfd_helper.ports_iter.return_value = [('xe0', 0), ('xe1', 1)]
+ helper.vnfd_helper = vnfd_helper
+
+ resource.check_if_system_agent_running.return_value = 0, '1234'
+ resource.amqp_collect_nfvi_kpi.return_value = 543
+ resource.check_if_system_agent_running.return_value = (0, None)
+
+ queue.empty.return_value = False
+ queue.get.return_value = {'a': 789}
+
+ expected = {'z': 123, 'a': 789,
+ 'collect_stats': {'core': 543},
+ 'live_stats': {'xe0': {'in_packets': 1, 'out_packets': 2}}}
+ result = helper.collect_kpi()
+ self.assertDictEqual(result, expected)
+
+ def test_collect_kpi_bad_data(self):
+ helper = prox_helpers.ProxResourceHelper(mock.MagicMock())
+ helper._queue = queue = mock.MagicMock()
+ helper._result = {'z': 123}
+
+ helper.client = mock.MagicMock()
+ helper.client.multi_port_stats.return_value = \
+ (False, [[0, 1, 2, 3, 4, 5], [1, 1, 2, 3, 4, 5]])
+ helper.client.multi_port_stats_diff.return_value = \
+ ([0, 1, 2, 3, 4, 5, 6, 7])
+ helper.client.multi_port_stats_tuple.return_value = \
+ {"xe0": {"in_packets": 1, "out_packets": 2}}
helper.resource = resource = mock.MagicMock()
+ vnfd_helper = mock.MagicMock()
+ vnfd_helper.ports_iter.return_value = [('xe0', 0), ('xe1', 1)]
+ helper.vnfd_helper = vnfd_helper
+
resource.check_if_system_agent_running.return_value = 0, '1234'
resource.amqp_collect_nfvi_kpi.return_value = 543
resource.check_if_system_agent_running.return_value = (0, None)
@@ -1577,7 +1728,8 @@ class TestProxResourceHelper(unittest.TestCase):
queue.empty.return_value = False
queue.get.return_value = {'a': 789}
- expected = {'z': 123, 'a': 789, 'collect_stats': {'core': 543}}
+ expected = {'z': 123, 'a': 789,
+ 'collect_stats': {'core': 543}}
result = helper.collect_kpi()
self.assertDictEqual(result, expected)
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py
index a7e61da0f..935d3fa30 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_prox.py
@@ -329,13 +329,27 @@ class TestProxTrafficGen(unittest.TestCase):
}
prox_traffic_gen._vnf_wrapper.resource_helper.resource = mock.MagicMock(
**{"self.check_if_system_agent_running.return_value": [False]})
+
+ vnfd_helper = mock.MagicMock()
+ vnfd_helper.ports_iter.return_value = [('xe0', 0), ('xe1', 1)]
+ prox_traffic_gen.resource_helper.vnfd_helper = vnfd_helper
+
+ prox_traffic_gen._vnf_wrapper.resource_helper.client = mock.MagicMock()
+ prox_traffic_gen._vnf_wrapper.resource_helper.client.multi_port_stats.return_value = \
+ [[0, 1, 2, 3, 4, 5], [1, 1, 2, 3, 4, 5]]
+ prox_traffic_gen._vnf_wrapper.resource_helper.client.multi_port_stats_diff.return_value = \
+ [0, 1, 2, 3, 4, 5, 6, 7], [0, 1, 2, 3, 4, 5, 6, 7]
+ prox_traffic_gen._vnf_wrapper.resource_helper.client.\
+ multi_port_stats_tuple.return_value = \
+ {"xe0": {"in_packets": 1, "out_packets": 2}}
+
prox_traffic_gen._vnf_wrapper.vnf_execute = mock.Mock(return_value="")
expected = {
- 'collect_stats': {},
+ 'collect_stats': {'live_stats': {'xe0': {'in_packets': 1, 'out_packets': 2}}},
'physical_node': 'mock_node'
}
- self.assertEqual(prox_traffic_gen.collect_kpi(), expected)
-
+ result = prox_traffic_gen.collect_kpi()
+ self.assertDictEqual(result, expected)
@mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.find_relative_file')
@mock.patch(