Skip to content

Instantly share code, notes, and snippets.

@Tsachi-Simplex
Last active July 6, 2017 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tsachi-Simplex/a4ee54cd743850a46183d68d6fd87102 to your computer and use it in GitHub Desktop.
Save Tsachi-Simplex/a4ee54cd743850a46183d68d6fd87102 to your computer and use it in GitHub Desktop.
influx dummy data population
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