Compare commits
4 commits
2e8a75e97e
...
25d47ff543
Author | SHA1 | Date | |
---|---|---|---|
|
25d47ff543 | ||
|
bfe8b8abeb | ||
|
355d882fe8 | ||
|
eb290338b5 |
6 changed files with 27 additions and 1 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "db/groupdate"]
|
||||||
|
path = db/groupdate
|
||||||
|
url = https://github.com/ankane/groupdate.sql
|
2
Gemfile
2
Gemfile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
1
db/groupdate
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit e8eaa5b42d9e0ccd1628240a8b86ceb975ed4205
|
14
db/migrate/20220324131233_groupdate.rb
Normal file
14
db/migrate/20220324131233_groupdate.rb
Normal 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
|
Loading…
Reference in a new issue