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

Move to a staged event driven model to write to the RRD #59

Closed
tobyweston opened this issue Feb 14, 2018 · 2 comments
Closed

Move to a staged event driven model to write to the RRD #59

tobyweston opened this issue Feb 14, 2018 · 2 comments
Labels
v2.1 ✓ Fixed and available in v2.1

Comments

@tobyweston
Copy link
Owner

tobyweston commented Feb 14, 2018

Currently, temperatures are sent to the server from multiple clients every 30 seconds. Each time they are sent, they are written directly into the RRD. The RRD has an arbitrary constraint whereby it only allows one write every second so it's entirely possible to accidentally break this rule, which results in an error.

Instead, I'd like to move to a staged event model where temperatures are stored in memory and periodically retrieved and stored in the RRD by an independent process.

tobyweston added a commit that referenced this issue Feb 17, 2018
…them to the RRD (next step to use a queue)
tobyweston added a commit that referenced this issue Feb 17, 2018
…em to the RRD. The queue is added to on every temperature upload
tobyweston added a commit that referenced this issue Feb 22, 2018
…, feed this into the RRD update so that measurements from different hosts at the same point in time get written to the RRD in one pass. Tries to avoid the RrdError of bad sample times (1 second between writes constraint). Removed ErrorOnTemperatureSpike for now. Some tension between the temperature writing traits :(
tobyweston added a commit that referenced this issue Feb 22, 2018
tobyweston added a commit that referenced this issue Feb 24, 2018
@tobyweston
Copy link
Owner Author

This was going well with like zero RRD 1 second errors until this...


Sat 24-Feb-201804:37:47.985 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom2: RrdError(Bad sample time: 1519486574. Last update time was 1519486632, at least one second step is required)
Sat 24-Feb-201809:45:18.006 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom2: RrdError(Bad sample time: 1519505035. Last update time was 1519505082, at least one second step is required)
Sat 24-Feb-201809:50:48.007 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom1: RrdError(Bad sample time: 1519505411. Last update time was 1519505412, at least one second step is required)
Sat 24-Feb-201809:51:47.975 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom1: RrdError(Bad sample time: 1519505423. Last update time was 1519505472, at least one second step is required)
Sat 24-Feb-201804:37:47.985 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom2: RrdError(Bad sample time: 1519486574. Last update time was 1519486632, at least one second step is required)
Sat 24-Feb-201809:45:18.006 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom2: RrdError(Bad sample time: 1519505035. Last update time was 1519505082, at least one second step is required)
Sat 24-Feb-201809:50:48.007 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom1: RrdError(Bad sample time: 1519505411. Last update time was 1519505412, at least one second step is required)
Sat 24-Feb-201809:51:47.975 [temperature-rrd-writing-thread-1] ERROR Error writing bedroom1: RrdError(Bad sample time: 1519505423. Last update time was 1519505472, at least one second step is required)

Need to check some timings above and muse on...

@tobyweston tobyweston added the v2.1 ✓ Fixed and available in v2.1 label May 10, 2018
@tobyweston
Copy link
Owner Author

Closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.1 ✓ Fixed and available in v2.1
Projects
None yet
Development

No branches or pull requests

1 participant