Skip to content

Commit e0f53cc

Browse files
committed
update example script
1 parent 9ba146f commit e0f53cc

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

example.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
from datetime import date, timedelta
33
from random import randint
4-
from databox import insert_all
54
from os import getenv
65

76
"""
@@ -14,23 +13,9 @@
1413

1514
client = Client(TOKEN)
1615

17-
# client.push('orders.total', 32, date='2015-01-01 09:00:00')
18-
19-
# key = 'temp.ljx'
20-
# rows = []
21-
#
22-
# for i, day in enumerate([date.today()-timedelta(days=d) for d in range(0, 14)]):
23-
# n = 20 + randint(0, 15)
24-
# rows.append({'key': key, 'value': n, 'date': day.strftime("%Y-%m-%d")})
25-
#
26-
# if insert_all(rows, token=TOKEN):
27-
# print "Inserted", len(rows), "rows."
28-
#
29-
#
30-
3116
push = client.push('transaction', 1447.4)
3217

33-
print client.insert_all([
18+
pushId = client.insert_all([
3419
{'key': 'temp.boston', 'value': 51},
3520
{'key': 'temp.boston', 'value': 49, 'date': '2015-01-01 17:00:00'},
3621
{'key': 'sales.total', 'value': 3000, 'attributes': {
@@ -40,10 +25,11 @@
4025
{'key': 'transaction', 'value': 45.6, 'unit': 'USD'}
4126
])
4227

43-
print "--------"
28+
print ("Push id: ", pushId)
4429

45-
lastPushes = client.last_push(3)
30+
# lastPushes = client.last_push(3)
31+
# print lastPushes
4632

47-
print client.get_push(lastPushes[0]['response']['body']['id'])
48-
print client.metrics()
49-
print client.purge()
33+
print (client.get_push(pushId))
34+
print (client.metrics())
35+
print (client.purge())

0 commit comments

Comments
 (0)