X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=near-rt-ric-simulator%2Fric-plt%2Fa1%2Fmain.py;h=a715f59f4cb07d5d66376a233a6bea5593071027;hb=6f1dc48780d7a816b3831bdcaad18fa1525dcbed;hp=48b7f2eaf931de713584a92fc22a7fcfdd9a4626;hpb=7164d4da7a92cfe8b19a23fda9442e419f1db34f;p=nonrtric.git 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):