/dde-iotserver-liveview

Primary LanguageElixirBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

DdeIotserverLiveview

Start shell in VM running the application:

iex -S mix

Various imports:

import NaiveDateTime
import Ecto.Query

Insert a raw timeseries:

DB.RawTimeseries.insert(DB.Stream.ensure("dev1", "sens3"), NaiveDateTime.from_gregorian_seconds(42), 42.0)

List stored raw timeseries:

DB.Repo.all(Ecto.Query.from(DB.RawTimeseries))

Ensure an analysis:

a1 = DB.Analysis.ensure("delme1")
a2 = DB.Analysis.ensure("delme2")

Ensure a stream:

s = DB.Stream.ensure("deldevice", "delsensor")

Ensure a derivation:

d1 = DB.Derivation.ensure(s, a1)
d2 = DB.Derivation.ensure(s, a2)

Ensure a derived timeseries value:

dt = DB.DerivedTimeseries.insert(d1, 0, 0, 0.0)