Improvements on aggregated data for TempService #20

Closed
opened 2026-03-27 16:10:04 +00:00 by Andras · 13 comments
Owner

TempService only has /latest och /all.

We need to have aggregated data under /year, /year/week ,/year/month

The aggregated data should be put into a (cached) DBS, so we don't need to compute them in real time, as that would create performance issues.

TempService only has /latest och /all. We need to have aggregated data under /year, /year/week ,/year/month The aggregated data should be put into a (cached) DBS, so we don't need to compute them in real time, as that would create performance issues.
Collaborator

I've created a cache and a http GET endpoint for the /temperature/year. Although I'm having a hard time getting it work as the only year right now is 2026. I'll continue tomorrow and try to get some function to work at least and leave the rest for a new issue maybe. If I don't get anything to work at all and it feels clunky I'll just delete the branch and give the issue to someone else.

I've created a cache and a http GET endpoint for the /temperature/year. Although I'm having a hard time getting it work as the only year right now is 2026. I'll continue tomorrow and try to get some function to work at least and leave the rest for a new issue maybe. If I don't get anything to work at all and it feels clunky I'll just delete the branch and give the issue to someone else.
Collaborator

After a meeting with our group I now understand that it's supposed to be mock data (fake data), and I also have a better understanding on what files to edit, so I'll continue with this problem anyway and give it another shot.

After a meeting with our group I now understand that it's supposed to be mock data (fake data), and I also have a better understanding on what files to edit, so I'll continue with this problem anyway and give it another shot.
b24hugst added reference #20-aggregated-data-for-tempservice 2026-04-10 10:03:58 +00:00
Collaborator

As the /year is now functioning(I think). I'll start working on /year/month. Would be very nice if you could make that into another issue @b24johka so the branches don't get mixed up.

As the **/year** is now functioning(I think). I'll start working on **/year/month**. Would be very nice if you could make that into another issue @b24johka so the branches don't get mixed up.
b24hugst changed reference from #20-aggregated-data-for-tempservice to #20-aggregated-data-for-tempservice 2026-04-13 12:41:04 +00:00
b24hugst changed reference from #20-aggregated-data-for-tempservice to #20-aggregated-temp-for-month-year 2026-04-13 12:41:09 +00:00
Collaborator

/year/month is now also working. So only /year/month/week to go.

/year/month is now also working. So only /year/month/week to go.
Collaborator

Is this issue still ongoing? I can see and test the yearly temps but months gives error 400. The logs for the tempService container gives outputs that it did retrieve temps however (see Images below).

I noticed that that April works, which is good, but does only April work? This also might not be in this issue, but shouldn't the View for month temp have selectable months? The same with years?

Would like an update so that I just know how we are doing on this issue?

Is this issue still ongoing? I can see and test the yearly temps but months gives error 400. The logs for the tempService container gives outputs that it did retrieve temps however (see Images below). I noticed that that April works, which is good, but does only April work? This also might not be in this issue, but shouldn't the View for month temp have selectable months? The same with years? Would like an update so that I just know how we are doing on this issue?
Collaborator

@a24timsv Yeah it's still /year/month/weeks that has to be implemented for the issue to be complete. I divided them a little since I had some troubles. I think only April works because that's the only month that's been saved so far. Although it shouldn't give a 400 http error. I didn't get much done on this last week as I got sick and worked on another issue but I'll look into it this week.

Yes the views for months and years should absolutely have selectable months and years, but I thought it would be better to put that as a new frontend issue instead as I wanted to focus purely on backend here.

I don't know about the 400 error. It shouldn't happen. Maybe something changed in the structure when I was sick. I will try to fix it!

@a24timsv Yeah it's still **/year/month/weeks** that has to be implemented for the issue to be complete. I divided them a little since I had some troubles. I think only April works because that's the only month that's been saved so far. Although it shouldn't give a 400 http error. I didn't get much done on this last week as I got sick and worked on another issue but I'll look into it this week. Yes the views for months and years should absolutely have selectable months and years, but I thought it would be better to put that as a new frontend issue instead as I wanted to focus purely on backend here. I don't know about the 400 error. It shouldn't happen. Maybe something changed in the structure when I was sick. I will try to fix it!
Collaborator

It's fine, I'm just trying to cleanup and check for abandoned issues. I can create a separate issue with the frontend components so that they have selectable years, months and weeks. The 400 error might be because the View defaults to a month that doesn't exist/have data.

Either way, it would be nice to have some faked history data so that the other variables can be tested. Maybe the mockup data can add temps to previous years in the database so something can be seen at least?

It's fine, I'm just trying to cleanup and check for abandoned issues. I can create a separate issue with the frontend components so that they have selectable years, months and weeks. The 400 error might be because the View defaults to a month that doesn't exist/have data. Either way, it would be nice to have some faked history data so that the other variables can be tested. Maybe the mockup data can add temps to previous years in the database so something can be seen at least?
Collaborator

I did include that whenever there's no data, it returns a 404 error instead, which the frontend handles to output "NO DATA" in a card.

I think 400 is something else that I'll look into now. And yes it would be nice to have some faked history data. Do you think it would be wise to have a new issue for that as well?

I did include that whenever there's no data, it returns a 404 error instead, which the frontend handles to output "NO DATA" in a card. I think 400 is something else that I'll look into now. And yes it would be nice to have some faked history data. Do you think it would be wise to have a new issue for that as well?
Collaborator

image

Yeah the 400 error in month is because someone wrote "February" as a string, instead of 2 as an integer. After I changed it now shows this instead:

image

![image](/attachments/85e5cc6f-2200-45d0-b086-199ca0d54d3e) Yeah the 400 error in month is because someone wrote "February" as a string, instead of 2 as an integer. After I changed it now shows this instead: ![image](/attachments/1a52c01f-c862-459e-9f99-90b6b17b5e0d)
Collaborator

That explains it.

Another issue was found when @a24julot made the frontend components changeable in #429. When selecting year and month it displays the month correctly but the year is always 2026. No matter what year is selected (example of year 5555).

That explains it. Another issue was found when @a24julot made the frontend components changeable in #429. When selecting year and month it displays the month correctly but the year is always 2026. No matter what year is selected (example of [year 5555](http://localhost/app/api/temperature/5555/4)).
Collaborator

I think I found the issue. I updated her branch in the pull request.

I think I found the issue. I updated her branch in the pull request.
Collaborator

@a24timsv Could you or @b24johka create another issue for the /month/week part and assign it to me? Gonna get weird with the branch naming otherwise. I will start on it after tomorrow's merge.

@a24timsv Could you or @b24johka create another issue for the /month/week part and assign it to me? Gonna get weird with the branch naming otherwise. I will start on it after tomorrow's merge.
Collaborator

This has been implemented. I close this issue in this pr #441

This has been implemented. I close this issue in this pr https://git.webug.se/Andras/BoundlessFlowCampus2K/pulls/441
Sign in to join this conversation.
No milestone
No project
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#20
No description provided.