Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Replace instances of timestamp with time for v0.9 release #205

Merged
merged 1 commit into from
Jun 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Here's a basic example (for more see the examples directory)::
"host": "server01",
"region": "us-west"
},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def main(host='localhost', port=8086):
"host": "server01",
"region": "us-west"
},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial_server_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main(host='localhost', port=8086, nb_day=15):
hostName = "server-%d" % random.randint(1, 5)
# pointValues = [int(past_date.strftime('%s')), value, hostName]
pointValues = {
"timestamp": int(past_date.strftime('%s')),
"time": int(past_date.strftime('%s')),
"measurement": metric,
'fields': {
'value': value,
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial_sine_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def main(host='localhost', port=8086):

point = {
"measurement": 'foobar',
"timestamp": int(now.strftime('%s')) + angle,
"time": int(now.strftime('%s')) + angle,
"fields": {
"value": y
}
Expand Down
14 changes: 7 additions & 7 deletions tests/influxdb/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def setUp(self):
"host": "server01",
"region": "us-west"
},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {
"value": 0.64
}
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_write(self):
"points": [{"measurement": "cpu_load_short",
"tags": {"host": "server01",
"region": "us-west"},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {"value": 0.64}}]}
)

Expand All @@ -160,7 +160,7 @@ def test_write(self):
"points": [{"measurement": "cpu_load_short",
"tags": {"host": "server01",
"region": "us-west"},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {"value": 0.64}}]}
)

Expand Down Expand Up @@ -212,18 +212,18 @@ def test_write_points_toplevel_attributes(self):
def test_write_points_batch(self):
dummy_points = [
{"measurement": "cpu_usage", "tags": {"unit": "percent"},
"timestamp": "2009-11-10T23:00:00Z", "fields": {"value": 12.34}},
"time": "2009-11-10T23:00:00Z", "fields": {"value": 12.34}},
{"measurement": "network", "tags": {"direction": "in"},
"timestamp": "2009-11-10T23:00:00Z", "fields": {"value": 123.00}},
"time": "2009-11-10T23:00:00Z", "fields": {"value": 123.00}},
{"measurement": "network", "tags": {"direction": "out"},
"timestamp": "2009-11-10T23:00:00Z", "fields": {"value": 12.00}}
"time": "2009-11-10T23:00:00Z", "fields": {"value": 12.00}}
]
expected_last_body = {"tags": {"host": "server01",
"region": "us-west"},
"database": "db",
"points": [{"measurement": "network",
"tags": {"direction": "out"},
"timestamp": "2009-11-10T23:00:00Z",
"time": "2009-11-10T23:00:00Z",
"fields": {"value": 12.00}}]}
with requests_mock.Mocker() as m:
m.register_uri(requests_mock.POST,
Expand Down