Exemple #1
0
        public string WritePoints(string dbName, string meas, [FromBody] DataRows data, string type = "float",
                                  bool truncateDbToFirstElement = false)
        {
            using (
                MeLog.LogDebug(
                    $"db: {dbName}, meas: {meas}, point#: {data.Rows.Count}, trunc: {truncateDbToFirstElement}"))
            {
                IMeasurement measurement = null;
                Locker.WriterLock(() =>
                {
                    var myDb    = DbService.DbManagement.GetDb(dbName);
                    measurement = myDb.GetOrCreateMeasurement(meas, type);
                });

                measurement.AppendDataPoints(data.AsIDataRows());
                return("ok");
            }
        }