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

Make SensorReadings a timescaledb table. #4463

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

haneslinger
Copy link
Contributor



class SensorReading(models.Model):
reading = models.FloatField(null=True)
timestamp = models.DateTimeField()
timestamp = TimescaleDateTimeField(interval="1 second")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably stay at the default of 7 days, 1-second sized chunks are super inefficient:
https://www.timescale.com/blog/timescale-cloud-tips-testing-your-chunk-size/#finding-your-optimal-chunk-size

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is interval not the granularity of the time stored? I can't find a definition

@axelstudios
Copy link
Member

axelstudios commented Jan 12, 2024

PR titles are automatically included in the changelog:

  • Update PR title to be consistent with changelog entries

@haneslinger haneslinger changed the title Fix 4252 Make SensorReadings a timescaledb table. Jan 12, 2024
@axelstudios
Copy link
Member

I think there's a better (magic) process we have to use for timescale tables, I'll add more details soon once I have time to go through this process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants