bjornregnell / sigrid

Help queue web app for lab sessions and tutorials.
Apache License 2.0
10 stars 5 forks source link

Add time waited to first in sigrid room queue. #38

Open ludde127 opened 1 year ago

ludde127 commented 1 year ago

Add a timer that shows some relevant information about who has waited the longest to allow ambulances to know which rooms are most congested time wise. One example of a solution is to add the time waited for the first person in the queue (Longest waiting).

bjornregnell commented 1 year ago

First step here: https://github.com/bjornregnell/sigrid/commit/b0a40ccd98f89b55f4d2343342563f4ffb39efbe

ludde127 commented 1 year ago

I have also been working on a solution and have one (probably finnished) in this fork https://github.com/ludde127/sigrid .

I did however mess with the User case class which might not be wanted.

bjornregnell commented 1 year ago

Yeah. Sorry for not checking with you before starting working on this. My solution is simpler I think. But there is one method left with ??? and there is some clutter in the printout...

ludde127 commented 1 year ago

No problem on not checking with me, I should have written here when i started the work. I think my solution works and the print out is quite nice, but i am a bit scared about the changes to User. image

bjornregnell commented 1 year ago

NIce output! Perhaps you can build on my work by integrating your printing functions and implement def longestWaitingTimeMinutes: Int = ??? in Room and use that in your strings? And I'll close your current PR?

bjornregnell commented 1 year ago

Or make one waiting time method per queue somtehing like def longestHelpWaitingTimeMinutes etc

bjornregnell commented 1 year ago

Or do you want me to finish the printing inspired by your PR?

ludde127 commented 1 year ago

Yes you can close the PR, i can however implement the printing methods if you have not already had time to finish them!

bjornregnell commented 1 year ago

Yes please go ahead if you like on the printing in showRoom etc by filtering out users from the pair etc. I can't work on this until tomorrow afternoon anyway. Ping @handledare on Discord if you need help with testing meanwhile, but then testers need to clone and run localhost... Let me know if someting tested can go live and I'll merge when I'm back on the keyboard.

ludde127 commented 1 year ago

I added the nicer printing to showRoomLong, not sure what showRoomShort is used for as showRoomLong seams to be used in beppe, sigrid, and sigrid monitor. I have tested adding multiple users to queues and if one is removed the next ones timer is shown, unsure what more to test. I settled on this look. image

bjornregnell commented 1 year ago

Nice! PR welcome! (I can review it tomorrow afternoon the earliest.)

bjornregnell commented 1 year ago

Perhaps remove decimals in minutes?

ludde127 commented 1 year ago

Yes that seams lika a nice idea, will probably only clutter the printout in read use! Creating a PR. (The printout now looks like this) image

bjornregnell commented 1 year ago

Thing left to do: Add longest queuing time in room overview at login. I think it was there i used the short form (?)

It is good to see this in the login page because then you can perhaps decide to go to a room with less waiting time...

ludde127 commented 1 year ago

I have started working on adding the maximum queuing time of both queues in each room to the short form. At the moment the login page looks like this. image

bjornregnell commented 1 year ago

Nice! I suggest skipping the dot and blank, so just Maxkötid in one word to save space.

bjornregnell commented 1 year ago

I actually meant just the current time of the student in front just like in the long form, but maximum queueing time is also interesting as it says something about the peak load during the 2h time slot. Perhaps both figures shoudl be in the overview of active rooms as it can be a basis for students to go to a room with low load.

bjornregnell commented 1 year ago

So my suggestion is having both Köat x min and Maxkötid y min, where the latter is counted during the lates 2h slot eith 8-10, 10-12, 13-15 or 15-17. Or did you mean the max of the two queues köat? That might also be a good definition of the maximum queuing-time momentarily, (The maximum peak load is perhaps not so important). Let's discuss this live.

ludde127 commented 1 year ago

I meant the current maximum queuing time of anyone in any of the queues (not the maximum over some timeframe). I don't really think that the maximum queuing time over a 2h time slot is useful for the login page. Yes, lets discuss live!

bjornregnell commented 1 year ago

Ok I see. Yes, that's probably more useful as an overview. (Statistics over history is actually another feature.) Go ahead with the PR inline with your original intent, and I can take a look at the code when you have a PR, if you like.