haystack / nb

11 stars 10 forks source link

Revert "stats on course content" very slow on PROD #211

Closed JumanaFM closed 2 years ago

JumanaFM commented 2 years ago

Reverts haystack/nb#209

JumanaFM commented 2 years ago

Hello @alizeeschoen The current code didn't work properly when deployed. It doesn't handle high numbers of annotations, sources, and students. NB has high traffic, can you please test the code with mock data to make sure the code is efficient. I suggest we start by making this feature available to instructors only for now to avoid dealing with sections.

karger commented 2 years ago

Alizee, can you let me know what this code was intending to do, and what algorithm you devised to do it, so we can figure out why it can't scale?

On 2/15/2022 2:23 PM, Jumana Almahmoud wrote:

Hello @alizeeschoen https://github.com/alizeeschoen The current code didn't work properly when deployed. It doesn't handle high numbers of annotations, sources, and students. NB has high traffic, can you please test the code with mock data to make sure the code is efficient. I suggest we start by making this feature available to instructors only for now to avoid dealing with sections.

— Reply to this email directly, view it on GitHub https://github.com/haystack/nb/pull/211#issuecomment-1040695988, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIWSXRYWDXAAQ5SN5J6CH3U3KR2ZANCNFSM5ONBPYVQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

alizeeschoen commented 2 years ago

@JumanaFM @karger This code intends to show the stats column (# of annotation per document, ...) on the course content. I think the reason it slow is because it fetches all annotations every 1min. Do you recommend any other way to make sure the annotations are updated live?

also @JumanaFM is there any way for me to test with a large amount of mock data without having to do it manually?

karger commented 2 years ago

nb already offers sockets that let a page receive notifications of new annotations, so you don't have to keep asking the server. your dashbord could set up a separate listening socket for each document.  Or, it might be better to create a new socket from the server that notifies of all new annotations in the class, so you can get all the info through a single socket.

One way to test with mock data would be to copy the database to create another fake database.

On 2/15/2022 7:52 PM, Alizee Schoen wrote:

@JumanaFM https://github.com/JumanaFM @karger https://github.com/karger This code intends to show the stats column (# of annotation per document, ...) on the course content. I think the reason it slow is because it fetches all annotations every 1min. Do you recommend any other way to make sure the annotations are updated live?

also @JumanaFM https://github.com/JumanaFM is there any way for me to test with a large amount of mock data without having to do it manually?

— Reply to this email directly, view it on GitHub https://github.com/haystack/nb/pull/211#issuecomment-1040951654, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIWSXXHQWFAGS77ZEGX5GTU3LYN5ANCNFSM5ONBPYVQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>