public async Task Flush() { var bucketName = _bucket.Name; var writeOptions = WriteOptions.CreateNew().BatchSize(10).FlushInterval(100_000).Build(); _writeApi = Client.GetWriteApi(writeOptions); var listener = new WriteApiTest.EventListener(_writeApi); var record = "h2o_feet,location=coyote_creek level\\ water_level=1.0 1"; _writeApi.WriteRecord(bucketName, _organization.Id, WritePrecision.Ns, record); _writeApi.Flush(); listener.WaitToSuccess(); var query = await _queryApi.QueryAsync( $"from(bucket:\"{bucketName}\") |> range(start: 1970-01-01T00:00:00.000000001Z)", _organization.Id); Assert.AreEqual(1, query.Count); var records = query[0].Records; Assert.AreEqual(1, records.Count); Assert.AreEqual("h2o_feet", records[0].GetMeasurement()); Assert.AreEqual(1, records[0].GetValue()); Assert.AreEqual("level water_level", records[0].GetField()); var instant = Instant.Add(Instant.FromUnixTimeMilliseconds(0), Duration.FromNanoseconds(1L)); Assert.AreEqual(instant, records[0].GetTime()); }
public ZonedDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
public ZonedDateTime PlusMilliseconds(long milliseconds) => this + Duration.FromMilliseconds(milliseconds);
public ZonedDateTime PlusSeconds(long seconds) => this + Duration.FromSeconds(seconds);
public ZonedDateTime PlusMinutes(int minutes) => this + Duration.FromMinutes(minutes);
public ZonedDateTime PlusHours(int hours) => this + Duration.FromHours(hours);
public OffsetDateTime Plus(Duration duration) => this + duration;
public ZonedDateTime Minus(Duration duration) => this - duration;
public OffsetDateTime Minus(Duration duration) => this - duration;
/// <summary> /// Subtracts a duration from an offset date and time. /// </summary> /// <remarks> /// This is an alternative way of calling <see cref="op_Subtraction(OffsetDateTime, Duration)"/>. /// </remarks> /// <param name="offsetDateTime">The value to subtract the duration from.</param> /// <param name="duration">The duration to subtract.</param> /// <returns>A new value with the time "rewound" by the given duration, in the same calendar system and with the same offset.</returns> public static OffsetDateTime Subtract(OffsetDateTime offsetDateTime, Duration duration) => offsetDateTime - duration;
public OffsetDateTime PlusNanoseconds(long nanoseconds) => this + Duration.FromNanoseconds(nanoseconds);
public OffsetDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
public OffsetDateTime PlusSeconds(long seconds) => this + Duration.FromSeconds(seconds);
public OffsetDateTime PlusMinutes(int minutes) => this + Duration.FromMinutes(minutes);
public OffsetDateTime PlusHours(int hours) => this + Duration.FromHours(hours);
public ZonedDateTime PlusNanoseconds(long nanoseconds) => this + Duration.FromNanoseconds(nanoseconds);
/// <summary> /// Subtracts a duration from a zoned date and time. /// </summary> /// <remarks> /// This is an alternative way of calling <see cref="op_Subtraction(ZonedDateTime, Duration)"/>. /// </remarks> /// <param name="zonedDateTime">The value to subtract the duration from.</param> /// <param name="duration">The duration to subtract.</param> /// <returns>A new value with the time "rewound" by the given duration, in the same calendar system and time zone.</returns> public static ZonedDateTime Subtract(ZonedDateTime zonedDateTime, Duration duration) => zonedDateTime - duration;
/// <summary> /// Adds a duration to a zoned date and time. /// </summary> /// <remarks> /// This is an alternative way of calling <see cref="op_Addition(ZonedDateTime, Duration)"/>. /// </remarks> /// <param name="zonedDateTime">The value to add the duration to.</param> /// <param name="duration">The duration to add</param> /// <returns>A new value with the time advanced by the given duration, in the same calendar system and time zone.</returns> public static ZonedDateTime Add(ZonedDateTime zonedDateTime, Duration duration) => zonedDateTime + duration;
public ZonedDateTime Plus(Duration duration) => this + duration;
/// <summary> /// Adds a duration to an offset date and time. /// </summary> /// <remarks> /// This is an alternative way of calling <see cref="op_Addition(OffsetDateTime, Duration)"/>. /// </remarks> /// <param name="offsetDateTime">The value to add the duration to.</param> /// <param name="duration">The duration to add</param> /// <returns>A new value with the time advanced by the given duration, in the same calendar system and with the same offset.</returns> public static OffsetDateTime Add(OffsetDateTime offsetDateTime, Duration duration) => offsetDateTime + duration;