Пример #1
0
 /// <summary>
 /// Writes a point to the specified database and measurement.
 /// </summary>
 /// <param name="db">The name of the database to write to.</param>
 /// <param name="measurement">The name of the measurement to write to.</param>
 /// <param name="tags">The list of tag values to write.</param>
 /// <param name="fields">The list of field values to write.</param>
 /// <param name="timeStamp">The point's time stamp.</param>
 /// <param name="retentionPolicy">The retention policy to write to.</param>
 /// <returns>An API response for the write request.</returns>
 public async override Task<InfluxDbApiResponse> WriteAsync(string db, string measurement,
     IDictionary<string, object> tags, IDictionary<string, object> fields,
     DateTime timeStamp, string retentionPolicy = null)
 {
     var point = new InfluxDbPoint(measurement, tags, fields, timeStamp);
     return await WriteAsync(db, point, retentionPolicy).ConfigureAwait(false);
 }
Пример #2
0
 /// <summary>
 /// Writes a point to the specified database and measurement.
 /// </summary>
 /// <param name="database">The name of the database to write to.</param>
 /// <param name="point">The InfluxDB point to write.</param>
 /// <param name="retentionPolicy">The retention policy to write to.</param>
 /// <returns>An API response for the write request.</returns>
 public async override Task<InfluxDbApiResponse> WriteAsync(string database, InfluxDbPoint point, string retentionPolicy = null)
 {
     if (string.IsNullOrWhiteSpace(database)) throw new ArgumentNullException("database");
     var p = new Point() { Name = point.Measurement, Fields = point.Fields, Tags = point.Tags, Timestamp = point.TimeStamp };
     var response = await influx.Client.WriteAsync(p, database,  retentionPolicy).ConfigureAwait(false);
     return new InfluxDbApiResponse(response.Body, response.StatusCode, response.Success);
 }
Пример #3
0
 /// <summary>
 /// Writes a point to the specified database and measurement.
 /// </summary>
 /// <param name="database">The name of the database to write to.</param>
 /// <param name="point">The InfluxDB point to write.</param>
 /// <param name="retentionPolicy">The retention policy to write to.</param>
 /// <returns>An API response for the write request.</returns>
 public abstract Task <InfluxDbApiResponse> WriteAsync(string database, InfluxDbPoint point, string retentionPolicy = null);