-
-
Save Tsachi-Simplex/a4ee54cd743850a46183d68d6fd87102 to your computer and use it in GitHub Desktop.
influx dummy data population
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from influxdb import InfluxDBClient | |
client = InfluxDBClient(host='localhost', port=8086, database='my_db') | |
measurement_1 = { | |
"measurement": "payment_attempts", | |
"tags": { | |
"email_domain": "gmail.com", | |
"id": "100" | |
}, | |
"time": datetime.datetime.utcnow(), | |
"fields": { | |
"value": 100.00 | |
} | |
} | |
measurement_2 = { | |
"measurement": "payment_attempts", | |
"tags": { | |
"email_domain": "yahoo.com", | |
"id": "100" | |
}, | |
"time": datetime.datetime.utcnow(), | |
"fields": { | |
"value": 100.00 | |
} | |
} | |
measurement_3 = { | |
"measurement": "payment_attempts", | |
"tags": { | |
"email_domain": "gmail.com", | |
"id": "200" | |
}, | |
"time": datetime.datetime.utcnow(), | |
"fields": { | |
"value": 100.00 | |
} | |
} | |
measurement_4 = { | |
"measurement": "payment_attempts", | |
"tags": { | |
"email_domain": "gmail.com", | |
"id": "200" | |
}, | |
"time": datetime.datetime.utcnow(), | |
"fields": { | |
"value": 100.00 | |
} | |
} | |
client.write_points([measurement_1, measurement_2, measurement_3, measurement_4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment