From d8ac479d72703cfe5aabbd08d049dc8a3dacf64a Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Fri, 19 Nov 2021 10:26:00 +0100 Subject: [PATCH] chg: [api] expose the total keys of a hashlookup server --- bin/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/server.py b/bin/server.py index c3822d3..f45e5a4 100644 --- a/bin/server.py +++ b/bin/server.py @@ -1,4 +1,4 @@ -version = "1.0" +version = "1.1" from flask import Flask, url_for, send_from_directory, render_template, make_response, request from flask_restx import Resource, Api, reqparse import redis @@ -263,7 +263,9 @@ class lookup(Resource): class info(Resource): def get(self): info = {} + lookup = rdb.info() info['nsrl-version'] = rdb.get('nsrl-version') + info['stat:hashlookup_total_keys'] = lookup['estimate_keys[default]'] info['stat:nsrl_modern_rds'] = rdb.get('stat:nsrl_modern_rds') info['stat:nsrl_legacy'] = rdb.get('stat:nsrl_legacy') info['stat:nsrl_ios'] = rdb.get('stat:nsrl_ios')