initial commit

This commit is contained in:
2019-04-24 11:42:20 +02:00
commit b4bbd6c250
8 changed files with 431 additions and 0 deletions

13
test.py Normal file
View File

@@ -0,0 +1,13 @@
from prometheus import Path, Counter, Gauge, Summary, GLOBAL_REGISTRY, NOW
g1 = Gauge(value=20, path=Path("foobar_g1", {"server": "[host:xy]"}), help="foo help with bar")
g2 = Gauge(path=Path("foobar_g2", {"server": "[host:xy]"}), help="foo help with bar")
g1.inc(10)
c = Counter(
path=Path("foobar", {"server": "[host:xy]"}), help="foo help with bar")
c.set(1024.12374981723)
s = Summary(path=Path("m_sum_foo", {"tag": "sum"}), help="count on it!")
s.observe(1)
s.observe(2)
s.observe(3, NOW)
print(GLOBAL_REGISTRY.collect())