From: BjornMagnussonXA Date: Tue, 10 Mar 2020 15:32:08 +0000 (+0100) Subject: Near-RT RIC simulator updates X-Git-Tag: 2.0.0~131^2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F2736%2F1;p=nonrtric.git Near-RT RIC simulator updates Added function to read metrics data. Change-Id: I7f02eab917e3838e50600d6eeaa1027186fdfef9 Issue-ID: NONRTRIC-154 Signed-off-by: BjornMagnussonXA --- 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):