summaryrefslogtreecommitdiff
path: root/datastore-leveldb/bin/insert_testdata.py
blob: d1fd74ab35297e758385cf6078a53c64d0b19937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import random
import math
import time
import requests

s = ["heizkreisregler9.solarDaten.tempKollektor",
    "heizkreisregler10.betriebsdatenRegler1.kesselTemperatur",
    "feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur"]

MINUTE = 1000 * 60
DAY = MINUTE * 60 * 24
NOW = long(time.time()*1000)
for i in range(NOW-14*DAY, NOW, MINUTE):
    for j,sensor in zip(range(len(s)),s):
        x = (float(i)/DAY)+j
        requests.put("http://localhost:8080/api/value/"+sensor+"/"+str(i),
                    str(50+50*math.sin(x)))