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

Docs: add documentation for Backend Metadata and Timedata #2314

Conversation

clehne
Copy link
Contributor

@clehne clehne commented Aug 12, 2023

Adds some basic backend documentation about Metadata and Timedata. Gives some more starter information on the usage of the influxdb and the aggregated influxdb bundle.

Note: needs PR #2313 to be accepted before.

@github-actions
Copy link

Code Coverage

@clehne clehne requested a review from DerStoecki August 21, 2023 12:27
Copy link
Contributor

@tsicking tsicking left a comment

Choose a reason for hiding this comment

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

I found some typos and inconsistencies. See my comments.

doc/modules/ROOT/pages/backend/metadata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/metadata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/metadata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/service.adoc Outdated Show resolved Hide resolved
io.openems.backend.timedata.aggregatedinflux/readme.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
@clehne
Copy link
Contributor Author

clehne commented Aug 24, 2023

@tsicking Thanks for reading. Great findings.

@github-actions
Copy link

Code Coverage

@github-actions
Copy link

Code Coverage

@github-actions
Copy link

Code Coverage

doc/modules/ROOT/pages/backend/timedata.adoc Outdated Show resolved Hide resolved
And only in a very few cases it gets the data from `DB 1`
(probably slower).


Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also mention what availableSince is doing?
I think it could be confusing when queries wont get handled by the AggregatedInflux because of it.

curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE DATABASE aggregated0"

curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE RETENTION POLICY rp_max ON aggregated0 DURATION 90d REPLICATION 1"
curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE RETENTION POLICY rp_avg ON aggregated0 DURATION 90d REPLICATION 1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should link to this documentation. And the more important configuration is the the shard duraction

If someone has the same settings for both retention policies they dont have to create the same one twice.

We are using two different retention policies:
For avg there should be data every 5-Minutes and the data in this measurement gets used for queries over one day and one week. Therefore we set the shard duration to 24h to only read two shards for a day query.

For max we used a shard duration fo 31 days because there is much less data in this measurement (only one per day) and to optimize queries for months only 2 shards need to be readed by the db.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. This is a valid comment, but in order to release these docs more quickly I decided to leave it out for now. I am happy to accept future documentation PRs from you. ;-)

@sfeilmeier sfeilmeier changed the title Feature/add backend metadata timedata doc Docs: add documentation for Backend Metadata and Timedata Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 1, 2023

Code Coverage

:icons: font
:imagesdir: ../../assets/images

The nature https://github.com/OpenEMS/openems/blob/36343dde95c832d80ec55177b412427480973b45/io.openems.backend.common/src/io/openems/backend/common/metadata/Metadata.java#L32[Metadata]
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to use the term 'Nature' only for Java interfaces, that also have Channel-IDs. (see https://openems.github.io/openems.io/openems/latest/coreconcepts.html#_nature). Metadata ist just a normal interface.

curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE DATABASE aggregated0"

curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE RETENTION POLICY rp_max ON aggregated0 DURATION 90d REPLICATION 1"
curl -i -XPOST http://127.0.0.1:8081/query --data-urlencode "q=CREATE RETENTION POLICY rp_avg ON aggregated0 DURATION 90d REPLICATION 1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. This is a valid comment, but in order to release these docs more quickly I decided to leave it out for now. I am happy to accept future documentation PRs from you. ;-)

@sfeilmeier sfeilmeier dismissed tsicking’s stale review October 1, 2023 19:00

The documentation is already very helpful the way it is. Future PRs can improve it further.

@sfeilmeier sfeilmeier merged commit 88f8d64 into OpenEMS:develop Oct 1, 2023
2 checks passed
This list is not complete.
====

include::service.adoc.d/_include.adoc[leveloffset=+0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello, just saw this file is missing on develop, can you readd it?

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