You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# Changelog
2
2
## unreleased
3
+
### Features
4
+
-[201](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/201) - Added option to specify timestamp precision and do not send timestamp. Set using `WriteOption::useServerTimestamptrue)`.
5
+
3
6
### Fixes
4
7
-[200](https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino/pull/200) - Backward compatible compilation. Solves _marked 'override', but does not override_ errors.
When a write precision is configured, the client will automatically assign the current time to the timestamp of each written point which doesn't have a timestamp assigned.
184
+
Automated assigning of timestamp can be turned off by using `WriteOption::useServerTimestamp(true)`. Client will still specify a timestamp precision for a server.
184
185
185
186
If you want to manage timestamp on your own, there are several ways to set the timestamp explicitly.
186
187
-`setTime(WritePrecision writePrecision)` - Sets the timestamp to the actual time in the desired precision. The same precision must set in WriteOptions.
Copy file name to clipboardExpand all lines: src/Options.h
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -62,8 +62,10 @@ class WriteOptions {
62
62
// Maximum count of retry attempts of failed writes, default 3
63
63
uint16_t _maxRetryAttempts;
64
64
// Default tags. Default tags are added to every written point.
65
-
// There cannot be duplicate tags in default tags and tags included in a point.
65
+
// There cannot be the same tags in the default tags and among the tags included with a point.
66
66
String _defaultTags;
67
+
// Let server assign timestamp in given precision. Do not sent timestamp.
68
+
bool _useServerTimestamp;
67
69
public:
68
70
WriteOptions():
69
71
_writePrecision(WritePrecision::NoTime),
@@ -72,17 +74,33 @@ class WriteOptions {
72
74
_flushInterval(60),
73
75
_retryInterval(5),
74
76
_maxRetryInterval(300),
75
-
_maxRetryAttempts(3) {
77
+
_maxRetryAttempts(3),
78
+
_useServerTimestamp(false) {
76
79
}
80
+
// Sets timestamp precision. If timestamp precision is set, but a point does not have a timestamp, timestamp is automatically assigned from the device clock.
81
+
// If useServerTimestamp is set to true, timestamp is not sent, only precision is specified for the server.
// Sets number of points that will be written to the databases at once. Points are added one by one and when number reaches batch size there are sent to server.
0 commit comments