Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store daily, weekly, monthly and yearly statistics #3

Closed
dennissiemensma opened this issue Nov 22, 2015 · 9 comments
Closed

Store daily, weekly, monthly and yearly statistics #3

dennissiemensma opened this issue Nov 22, 2015 · 9 comments
Milestone

Comments

@dennissiemensma
Copy link
Member

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


The current compactor only compact gas each hour and electricity each reading (~ 10 seconds).

In order to support statistics and graphs on daily, weekly, monthly and yearly basis we should make another compactor.
To keep things separated, we might have to rename the existing compactor to something similar as 'extractor'.


@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


Ik heb het compacten in ieder geval, voor electriciteit, nu op minuut-basis ipv seconde-basis. Hiervoor mag een extra argument meegegeven worden aan het compacter-command + een (handmatige) call met --purge.

Dit is in ieder geval al een voorzet voor bovenstaande, diepgaandere statistieken.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


The source data should just be the daily consumption, stored in the database, while having trends plot out of them.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


ElectricityStatistics should focus on usage only. Other data, such as long_power_failure_count, should be read from the last telegram reading anyway. ElectricityStatistics is just an expensive caching mechanism, now.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


This will also greatly speed up the rendering of the history page.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


Hmm I want this but only since Django 1.9: https://docs.djangoproject.com/en/dev/ref/models/querysets/#date

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


Django 1.9 seems to run fine, but I do not want to switch yet, as 1.8 is LTS.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


Made quite some progress, tomorrow GUI I hope.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


Merged into default! Rolling to production here before marking stable.

@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


@JeroenPeters ook deze change is klaar en voegt eindelijk heel wat visuele dingen toe!

  • Dagstatistieken (totalen)
  • Trends, voorlopig nog op uur basis. (dus in welke uren je gemiddelde verbruik zit)
  • ChartJS update, waardoor een hoop issues gefixt zijn. Zoals tooltips op data en een responsive design (volledige breedte nu + resize)

Voor het uitrollen is het wel handig om even je compactor/backend proces uit te zetten. Statistieken over alle gemeten dagen worden namelijk herberekend in de migratie (duurde bij mij ongeveer een minuut).
Een database dump is niet perse nodig, maar wel aan te raden. Als eerdergenoemde misgaat door contraints of iets, kun je het makkelijker terugzetten dan zelf graven in alle data.


Check ook even of je management commands in supervisnor nog bijgewerkt moeten worden (qua config). Dit is bij de vorige grote refactoreslag ook veranderd, maar ze zijn deprecated (nog) compatible. Deze processen zijn alleen nodig:

  • dsmr_backend (ipv dsmr_stats_compactor, blijft los proces maar verplaatst naar eigen app)
  • dsmr_datalogger (ipv dsmr_stats_datalogger, vervangt alle backend zooi)
  • dsmr_webinterface (naam maakt niet zoveel uit, is toch gunicorn entrypoint en daarmee onveranderd)

@dennissiemensma dennissiemensma added this to the 0.8 (β) milestone Feb 7, 2016
dennissiemensma added a commit that referenced this issue Feb 7, 2016
dennissiemensma added a commit that referenced this issue Feb 7, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Feb 8, 2016
Merge with f8e9d284a27bb3e39e35ec36b6ad50c93bd564ad
dennissiemensma added a commit that referenced this issue Feb 8, 2016
dennissiemensma added a commit that referenced this issue Dec 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant