csharp 通过SensorSerial和时间从表/扇出中清除InfluxDB读取数据。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 通过SensorSerial和时间从表/扇出中清除InfluxDB读取数据。相关的知识,希望对你有一定的参考价值。

private async Task DeleteReadings()
{
  IList<string> serials = new List<string>()
  {
      "000D6F0004D0CB62",
      "000D6F0004D0CCC2",
      "000D6F0004D0C8F1",
      "000D6F0004D0CA7A",
      "000D6F0004D0CD2E",
      "000D6F0004D0CDD8",
      "000D6F0004D0C2BB",
      "000D6F0004D0C4D0",
      "000D6F0004D0E21D",
      "000D6F0004D0C8AA",
      "000D6F0004D0CE81",
      "000D6F0004D0D167",
      "000D6F0004D0C20F",
      "000D6F0004D0C723",
      "000D6F0004D0D0F6",
      "000D6F0004D0CA27",
      "000D6F0004D0D2E5",
      "000D6F0004D0C574"
  };

  foreach (var serial in serials)
  {
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 30s.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 1m.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 5m.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 1h.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 1d.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
      _influxDbClient.QueryAsync(_influxDbName, String.Format("delete from 1w.reading.{0} where time < '2015-06-23 23:59:59.999'", serial), TimeUnit.Milliseconds);
  }
}

以上是关于csharp 通过SensorSerial和时间从表/扇出中清除InfluxDB读取数据。的主要内容,如果未能解决你的问题,请参考以下文章

csharp 一个简单的帮助器,用于转换为/从unix时间戳和计算时间。

csharp 从Unity3D中的CoherentUI浏览器获取PCM音频数据,并通过Unity音频过滤器播放。

Linux 和 Csharp,检查 Linux 中是不是不存在文件/文件夹,如果存在,则通过 Csharp SSH 运行 MKDIR - [关闭]

csharp 通过反射从App_Code获取类型。 http://stackoverflow.com/questions/331564/how-to-use-reflection-to-create-

csharp Epicor:从午夜到实际时间转换秒数

csharp 编码和解码从bgra到ycocg颜色空间。