Skip to content

Commit

Permalink
Make api credentials constant for easier configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake Smith committed Jan 29, 2013
1 parent 6679d2e commit 801b462
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
7 changes: 6 additions & 1 deletion tempodb/demo/tempodb-bulk-write-demo.py
Expand Up @@ -5,7 +5,12 @@
import datetime
from tempodb import Client

client = Client('your-api-key', 'your-api-secret')
# Modify these with your credentials found at: http://tempo-db.com/manage/
API_KEY = 'your-api-key'
API_SECRET = 'your-api-secret'
SERIES_KEY = 'your-custom-key'

client = Client(API_KEY, API_SECRET)

ts = datetime.datetime.now()
data = [
Expand Down
9 changes: 7 additions & 2 deletions tempodb/demo/tempodb-read-demo.py
Expand Up @@ -5,12 +5,17 @@
import datetime
from tempodb import Client

client = Client('your-api-key', 'your-api-secret')
# Modify these with your settings found at: http://tempo-db.com/manage/
API_KEY = 'your-api-key'
API_SECRET = 'your-api-secret'
SERIES_KEY = 'your-custom-key'

client = Client(API_KEY, API_SECRET)

start = datetime.date(2012, 1, 1)
end = start + datetime.timedelta(days=1)

data = client.read_key('your-custom-key', start, end)
data = client.read_key(SERIES_KEY, start, end)

for datapoint in data.data:
print datapoint
9 changes: 7 additions & 2 deletions tempodb/demo/tempodb-write-demo.py
Expand Up @@ -6,7 +6,12 @@
import random
from tempodb import Client, DataPoint

client = Client('your-api-key', 'your-api-secret')
# Modify these with your credentials found at: http://tempo-db.com/manage/
API_KEY = 'your-api-key'
API_SECRET = 'your-api-secret'
SERIES_KEY = 'your-custom-key'

client = Client(API_KEY, API_SECRET)

date = datetime.datetime(2012, 1, 1)

Expand All @@ -20,4 +25,4 @@
data.append(DataPoint(date, random.random() * 50.0))
date = date + datetime.timedelta(minutes=1)

client.write_key('your-custom-key', data)
client.write_key(SERIES_KEY, data)

0 comments on commit 801b462

Please sign in to comment.