From 6f1dc48780d7a816b3831bdcaad18fa1525dcbed Mon Sep 17 00:00:00 2001 From: BjornMagnussonXA Date: Tue, 10 Mar 2020 16:32:08 +0100 Subject: [PATCH] Near-RT RIC simulator updates Added function to read metrics data. Change-Id: I7f02eab917e3838e50600d6eeaa1027186fdfef9 Issue-ID: NONRTRIC-154 Signed-off-by: BjornMagnussonXA --- near-rt-ric-simulator/ric-plt/a1/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/near-rt-ric-simulator/ric-plt/a1/main.py b/near-rt-ric-simulator/ric-plt/a1/main.py index 48b7f2ea..a715f59f 100644 --- a/near-rt-ric-simulator/ric-plt/a1/main.py +++ b/near-rt-ric-simulator/ric-plt/a1/main.py @@ -88,6 +88,18 @@ def set_status_with_reason(policyId, enforceStatus, enforceReason): policy_status[policyId] = ps return("Status updated for policy: " + policyId, 200) +#Metrics function + +@app.route('/counter/', methods=['GET']) +def getCounter(countername): + if (countername == "num_instances"): + return str(len(policy_instances)),200 + elif (countername == "num_types"): + return str(len(policy_types)),200 + else: + return "Counter name: "+countername+" not found.",404 + + port_number = 8085 if len(sys.argv) >= 2: if isinstance(sys.argv[1], int): -- 2.16.6