Skip to content

Commit f6789cd

Browse files
author
Enric Sala
committed
Remove the point builder, it was obsoleted by the series builder
Also update the usage examples in the README file
1 parent d89f4e9 commit f6789cd

File tree

3 files changed

+17
-282
lines changed

3 files changed

+17
-282
lines changed

README.md

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,49 +57,33 @@ influxdb.setWriteTimeout(10);
5757
Writing data
5858
------------
5959

60-
Use the `Point` builder to create samples, then save them in a batch:
60+
Use the `Series` builder to prepare the data, then write it using the client:
6161

6262
```matlab
63-
% Create a point
64-
p1 = Point('weather') ...
63+
% Create a series with a single sample
64+
series1 = Series('weather') ...
6565
.tags('city', 'barcelona', 'country', 'catalonia') ...
6666
.fields('temperature', 24.3, 'humidity', 70.4) ...
67-
.time(datetime('now', 'TimeZone', 'local'));
67+
.time(datetime('today', 'TimeZone', 'local'));
6868
69-
% Create another point
70-
p2 = Point('weather') ...
69+
% Create a series with many samples
70+
series2 = Series('weather') ...
7171
.tags('city', 'copenhagen', 'country', 'denmark') ...
72-
.fields('temperature', 12.6, 'humidity', 45.7) ...
73-
.time(datetime('now', 'TimeZone', 'local'));
74-
75-
% Create an array of points
76-
array = [p3, p4, etc];
77-
78-
% Save all the points
79-
influxdb.writer() ...
80-
.append(p1, p2, etc) ...
81-
.append(array) ...
82-
.execute();
83-
```
84-
85-
It is possible to save *large* amounts of samples using the `Series` builder:
86-
87-
```matlab
88-
% Create a series with many points
89-
series1 = Series('weather') ...
90-
.tags('city', 'stockholm', 'country', 'sweden') ...
91-
.fields('temperature', [10.5; 11.2; 9.7]) ...
92-
.time(datetime('now', 'TimeZone', 'local') - [0; 1; 2] / 24);
72+
.fields('temperature', [12.6; 11.8], 'humidity', [45.7; 46.3]) ...
73+
.time(datetime('now', 'TimeZone', 'local') - [0; 1] / 24);
9374
9475
% Create a series from an existing timetable
95-
ttable = timetable(time, variables, etc);
96-
series2 = Series('weather') ...
76+
series3 = Series('weather') ...
9777
.tags('city', 'helsinki', 'country', 'finland') ...
98-
.import(ttable);
78+
.import(my_timetable);
79+
80+
% Create an array of series
81+
series_array = [series4, series5, etc];
9982
100-
% Save the series
83+
% Save all the series in a batch
10184
influxdb.writer() ...
102-
.append(series1, series2) ...
85+
.append(series1, series2, series3) ...
86+
.append(series_array) ...
10387
.execute();
10488
```
10589

@@ -112,7 +96,7 @@ influxdb.writer() ...
11296
.precision('ms') ...
11397
.retention('two_weeks') ...
11498
.consistency('quorum') ...
115-
.append(points, series) ...
99+
.append(series, etc) ...
116100
.execute();
117101
```
118102

influxdb-client/Point.m

Lines changed: 0 additions & 101 deletions
This file was deleted.

tests/PointTest.m

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)