Compare commits

...

4 commits

Author SHA1 Message Date
f
25d47ff543 poder usar raspberries en los filtros
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-03-24 10:24:33 -03:00
f
bfe8b8abeb poder usar nombres de sensores como filtros 2022-03-24 10:23:10 -03:00
f
355d882fe8 detección de anomalías 2022-03-24 10:22:49 -03:00
f
eb290338b5 instalar groupdate 2022-03-24 10:22:29 -03:00
6 changed files with 27 additions and 1 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "db/groupdate"]
path = db/groupdate
url = https://github.com/ankane/groupdate.sql

View file

@ -27,6 +27,8 @@ gem 'bootsnap', '>= 1.4.4', require: false
gem 'ssh_data' gem 'ssh_data'
gem 'anomaly_detection'
group :development, :test do group :development, :test do
gem 'pry' gem 'pry'
end end

View file

@ -60,6 +60,8 @@ GEM
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
zeitwerk (~> 2.3) zeitwerk (~> 2.3)
anomaly_detection (0.1.4-x86_64-linux-musl)
rice (>= 4.0.2)
ast (2.4.2) ast (2.4.2)
bcrypt (3.1.17-x86_64-linux-musl) bcrypt (3.1.17-x86_64-linux-musl)
bindex (0.8.1-x86_64-linux-musl) bindex (0.8.1-x86_64-linux-musl)
@ -184,6 +186,7 @@ GEM
actionpack (>= 5.0) actionpack (>= 5.0)
railties (>= 5.0) railties (>= 5.0)
rexml (3.2.5) rexml (3.2.5)
rice (4.0.3)
rubocop (1.26.0) rubocop (1.26.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.1.0.0) parser (>= 3.1.0.0)
@ -248,6 +251,7 @@ PLATFORMS
x86_64-linux-musl x86_64-linux-musl
DEPENDENCIES DEPENDENCIES
anomaly_detection
blazer blazer
bootsnap (>= 1.4.4) bootsnap (>= 1.4.4)
brakeman brakeman

View file

@ -22,6 +22,8 @@ data_sources:
use_transaction: true use_transaction: true
smart_variables: smart_variables:
local_type: "select distinct local_type from sensors"
raspberry_id: "select id, name from raspberries"
# zone_id: "SELECT id, name FROM zones ORDER BY name ASC" # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
# period: ["day", "week", "month"] # period: ["day", "week", "month"]
# status: {0: "Active", 1: "Archived"} # status: {0: "Active", 1: "Archived"}
@ -63,7 +65,7 @@ check_schedules:
# enable anomaly detection # enable anomaly detection
# note: with trend, time series are sent to https://trendapi.org # note: with trend, time series are sent to https://trendapi.org
# anomaly_checks: trend / r anomaly_checks: anomaly_detection
# enable forecasting # enable forecasting
# note: with trend, time series are sent to https://trendapi.org # note: with trend, time series are sent to https://trendapi.org

1
db/groupdate Submodule

@ -0,0 +1 @@
Subproject commit e8eaa5b42d9e0ccd1628240a8b86ceb975ed4205

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
# Instala las funciones de agrupamiento por fecha
class Groupdate < ActiveRecord::Migration[6.1]
def up
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'install.sql')).sub(/(BEGIN|COMMIT);/, ''
ActiveRecord::Base.connection.execute(groupdate)
end
def down
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'uninstall.sql')).sub(/(BEGIN|COMMIT);/, ''
ActiveRecord::Base.connection.execute(groupdate)
end
end