diff --git a/README.rst b/README.rst index b6c7e2b3..8a363540 100644 --- a/README.rst +++ b/README.rst @@ -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 } diff --git a/examples/tutorial.py b/examples/tutorial.py index d144049a..64e95778 100644 --- a/examples/tutorial.py +++ b/examples/tutorial.py @@ -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 } diff --git a/examples/tutorial_server_data.py b/examples/tutorial_server_data.py index f17def9b..b5b26d1c 100644 --- a/examples/tutorial_server_data.py +++ b/examples/tutorial_server_data.py @@ -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, diff --git a/examples/tutorial_sine_wave.py b/examples/tutorial_sine_wave.py index aad6872d..414dd10d 100644 --- a/examples/tutorial_sine_wave.py +++ b/examples/tutorial_sine_wave.py @@ -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 } diff --git a/tests/influxdb/client_test.py b/tests/influxdb/client_test.py index 8e76d271..ebb6ad92 100644 --- a/tests/influxdb/client_test.py +++ b/tests/influxdb/client_test.py @@ -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 } @@ -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}}]} ) @@ -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}}]} ) @@ -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, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy