Skip to content

Commit f7f30b5

Browse files
author
Shan Desai
authored
Refactor tutorial_udp example for timestamps (influxdata#808)
- `time` key should be within each datapoint - This PR addresses influxdata#788 regarding the structure of the data when inserting via UDP. - The original documentation contributed by me took the structure of the `tutorial.py` as base. However, upon testing, the timestamp in the example are not written (2020 is written as opposed to 2009). - Tested for `influxdb-python` v5.2.3 and InfluxDB v1.6.1
1 parent 351b98a commit f7f30b5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples/tutorial_udp.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,19 @@ def main(uport):
2929
"host": "server01",
3030
"region": "us-west"
3131
},
32-
"time": "2009-11-10T23:00:00Z",
3332
"points": [{
3433
"measurement": "cpu_load_short",
3534
"fields": {
3635
"value": 0.64
37-
}
36+
},
37+
"time": "2009-11-10T23:00:00Z",
3838
},
39-
{
40-
"measurement": "cpu_load_short",
41-
"fields": {
42-
"value": 0.67
43-
}
39+
{
40+
"measurement": "cpu_load_short",
41+
"fields": {
42+
"value": 0.67
43+
},
44+
"time": "2009-11-10T23:05:00Z"
4445
}]
4546
}
4647

0 commit comments

Comments
 (0)
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