From 18c52de216229ece8433a979abfcc28c9480a895 Mon Sep 17 00:00:00 2001 From: Oskari Timperi Date: Thu, 21 Nov 2019 20:14:15 +0200 Subject: Documentation --- src/create_database.nim | 22 ++++++++++++++++------ src/update_database.nim | 10 ++++------ 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/create_database.nim b/src/create_database.nim index f210c6f..82f473c 100644 --- a/src/create_database.nim +++ b/src/create_database.nim @@ -1,14 +1,24 @@ +## RRD database creation tool. +## +## The database will store the following data: +## +## - 1 year worth of samples each 15 minutes +## - average of each day for 10 years +## - min of each day for 10 years +## - max of each day for 10 years +## +## The data contained in the database is +## +## - temperature +## - relative humidity +## - pressure +## - battery voltage + import os import osproc import strformat import strutils -# This database will store the following data -# - 1 year worth of samples each 15 minutes -# - average of each day for 10 years -# - min of each day for 10 years -# - max of each day for 10 years - let database = getAppDir().parentDir() / "database" / paramStr(1) & ".rrd" step = 15 * 60 diff --git a/src/update_database.nim b/src/update_database.nim index a5e5078..2c2c7e3 100644 --- a/src/update_database.nim +++ b/src/update_database.nim @@ -19,15 +19,13 @@ ## The program should be run with an accompanying CGI script as the main driver. The web server will ## execute the script which looks like this: ## -## #!/path/to/update_database -## databaseDir = /path/to/where/databases/are -## -## This will execute update_database with one argument: the path to this script file. -## update_database will read this script and parse it as a configuration file. The databaseDir -## option should point to where the .rrd databases are stored. +## #!/bin/sh +## /path/to/update_database ## ## The update_database program will use the ``alias`` from measurements as the database name (with ## ``.rrd`` extension). +## +## Databases are found relative to this executable, from ``../database``. import json import os -- cgit v1.2.3