public async Task TestPostPointAsyncNonDefaultRetention()
{
try
{
var client = new InfluxDBClient(influxUrl, dbUName, dbpwd);
var time = DateTime.Now;
var rand = new Random();
var valMixed = new InfluxDatapoint <InfluxValueField>();
valMixed.UtcTimestamp = DateTime.UtcNow;
valMixed.Tags.Add("TestDate", time.ToShortDateString());
valMixed.Tags.Add("TestTime", time.ToShortTimeString());
valMixed.Fields.Add("Doublefield", new InfluxValueField(rand.NextDouble()));
valMixed.Fields.Add("Stringfield", new InfluxValueField(DataGen.RandomString()));
valMixed.Fields.Add("Boolfield", new InfluxValueField(true));
valMixed.Fields.Add("Int Field", new InfluxValueField(rand.Next()));
valMixed.MeasurementName = measurementName;
valMixed.Precision = TimePrecision.Seconds;
valMixed.Retention = new InfluxRetentionPolicy()
{
Duration = TimeSpan.FromHours(6)
};
var r = await client.PostPointAsync(dbName, valMixed);
Assert.IsTrue(r && valMixed.Saved, "PostPointAsync retunred false");
}
catch (Exception e)
{
Assert.Fail($"Unexpected exception of type {e.GetType()} caught: {e.Message}");
return;
}
}