From 3f21122769b57fa4b07a0344976b982f3d3ef6d3 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Fri, 18 Aug 2023 21:14:15 +0200 Subject: [PATCH] Use random time stamps Don't remember what I wanted to test there ... --- ltsdb_test | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ltsdb_test b/ltsdb_test index 373d7c1..b22a3bf 100755 --- a/ltsdb_test +++ b/ltsdb_test @@ -1,20 +1,22 @@ #!/usr/bin/python3 +import time +import random from ltsdb_json import LTS ts1 = LTS({"hostname": "rorschach.hjp.at", "measure": "uptime"}) -ts1.add(1661026122, 4) +ts1.add(time.time(), 4 + random.random()) ts1.save() ts1 = LTS({"hostname": "rorschach.hjp.at", "website": "i12e.hjp.at", "measure": "rtt"}) -ts1.add(1661026122, 0.06) +ts1.add(time.time(), 0.06) ts1.save() ts1 = LTS({"hostname": "rorschach.hjp.at", "measure": "uptime"}) -ts1.add(1661026361, 5) +ts1.add(time.time() + 240, 5 + random.random()) ts1.save() ts1 = LTS({"hostname": "charly.wsr.ac.at", "website": "www.wifo.ac.at", "measure": "rtt"}) -ts1.add(1661026122, 0.347) +ts1.add(time.time(), 0.347) ts1.save()