]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Convert metrics_table.py to a module 16479/head
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Wed, 12 Nov 2025 18:41:02 +0000 (13:41 -0500)
committerJosh Soref <2119212+jsoref@users.noreply.github.com>
Wed, 12 Nov 2025 18:41:02 +0000 (13:41 -0500)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
pdns/recursordist/metrics.py
pdns/recursordist/metrics_table.py

index 3d11b68973df429850d19f790e31e1dc660d0793..63d004eccdee26678513f5d2c31db8f2cb1f9d3e 100644 (file)
@@ -1,6 +1,7 @@
 import os
 import sys
 import shutil
+import metrics_table
 
 # default: 'type': uint64
 # ptype: "'counter' (vs gauge')
@@ -31,9 +32,7 @@ def dedashForSNMP(name):
     ret = ret.replace('Nsec', 'NSEC')
     return ret
 
-# read table
-with open(srcdir + '/metrics_table.py', mode='r', encoding="utf-8") as file:
-    table = eval(file.read())
+table = metrics_table.table
 
 #
 # We create various files in the srcdir but copy them into the builddir if needed to satisfy meson
index 2a4da2299ce964d824ecd23dc19542a57bcd4cb5..8370ce2db10f8f448426d2e6402f61dfafe8c6e1 100644 (file)
@@ -24,7 +24,7 @@
 #   }
 #
 
-[
+table = [
     {
         'name': 'questions',
         'lambda': '[] { return g_Counters.sum(rec::Counter::qcounter); }',