Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
 public ZonedDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
Ejemplo n.º 3
0
 public ZonedDateTime PlusMilliseconds(long milliseconds) => this + Duration.FromMilliseconds(milliseconds);
Ejemplo n.º 4
0
 public ZonedDateTime PlusSeconds(long seconds) => this + Duration.FromSeconds(seconds);
Ejemplo n.º 5
0
 public ZonedDateTime PlusMinutes(int minutes) => this + Duration.FromMinutes(minutes);
Ejemplo n.º 6
0
 public ZonedDateTime PlusHours(int hours) => this + Duration.FromHours(hours);
Ejemplo n.º 7
0
 public OffsetDateTime Plus(Duration duration) => this + duration;
Ejemplo n.º 8
0
 public ZonedDateTime Minus(Duration duration) => this - duration;
Ejemplo n.º 9
0
 public OffsetDateTime Minus(Duration duration) => this - duration;
Ejemplo n.º 10
0
 /// <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;
Ejemplo n.º 11
0
 public OffsetDateTime PlusNanoseconds(long nanoseconds) => this + Duration.FromNanoseconds(nanoseconds);
Ejemplo n.º 12
0
 public OffsetDateTime PlusTicks(long ticks) => this + Duration.FromTicks(ticks);
Ejemplo n.º 13
0
 public OffsetDateTime PlusSeconds(long seconds) => this + Duration.FromSeconds(seconds);
Ejemplo n.º 14
0
 public OffsetDateTime PlusMinutes(int minutes) => this + Duration.FromMinutes(minutes);
Ejemplo n.º 15
0
 public OffsetDateTime PlusHours(int hours) => this + Duration.FromHours(hours);
Ejemplo n.º 16
0
 public ZonedDateTime PlusNanoseconds(long nanoseconds) => this + Duration.FromNanoseconds(nanoseconds);
Ejemplo n.º 17
0
 /// <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;
Ejemplo n.º 18
0
 /// <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;
Ejemplo n.º 19
0
 public ZonedDateTime Plus(Duration duration) => this + duration;
Ejemplo n.º 20
0
 /// <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;