mirror of
https://github.com/adulau/hashlookup-server.git
synced 2024-11-07 12:06:27 +00:00
chg: [dns] update stats
This commit is contained in:
parent
dbb5fc918e
commit
7beed8849c
1 changed files with 8 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
|||
version = "0.1"
|
||||
version = "0.2"
|
||||
from nserver import NameServer, Response, A, NS, TXT
|
||||
import redis
|
||||
import json
|
||||
|
@ -14,13 +14,9 @@ def say_info(query):
|
|||
#if query.name.endswith(".com.au"):
|
||||
# return TXT(query.name, "G'day mate")
|
||||
info = {}
|
||||
lookup = rdb.info()
|
||||
info['nsrl-version'] = rdb.get('nsrl-version')
|
||||
info['nsrl-NSRL-items'] = rdb.get('stat:import')
|
||||
info['nsrl-Android-items'] = rdb.get('stat:NSRLAndroid')
|
||||
info['nsrl-iOS-items'] = rdb.get('stat:NSRLiOS')
|
||||
info['nsrl-NSRLMfg'] = rdb.get('stat:NSRLMfg-import')
|
||||
info['nsrl-NSRLOS'] = rdb.get('stat:NSRLOS-import')
|
||||
info['nsrl-NSRLProd'] = rdb.get('stat:NSRLProd-import')
|
||||
info['stat:hashlookup_total_keys'] = lookup['estimate_keys[default]']
|
||||
info['hashlookup-version'] = version
|
||||
return TXT(query.name, json.dumps(info))
|
||||
|
||||
|
@ -54,6 +50,11 @@ def wildcard_hashlookup(query):
|
|||
|
||||
return TXT(query.name, json.dumps(h))
|
||||
|
||||
#@ns.rule("**", ["ANY"])
|
||||
#def do_nothing(query):
|
||||
# print(query)
|
||||
# return TXT(query.name, "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ns.settings.SERVER_PORT = 53 # It's over 9000!
|
||||
|
|
Loading…
Reference in a new issue