Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Fix time estimation #3

Open
leftmove opened this issue Mar 12, 2024 · 2 comments
Open

Fix time estimation #3

leftmove opened this issue Mar 12, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@leftmove
Copy link
Owner

Time estimation has been broken for a while.

It is either too slow or not functional whatsoever. Additonally, the "algorithmn" is a simple divide by two function that gives an incredibly rough "estimation." Since wallstretlocal has gone public, there are now enough statistics in the database to create a reasonable average time required using log counts.

  • Make estimation faster
  • Using estimated log count from counted stocks, create time estimation based on average taken from statistics collection
@leftmove leftmove assigned leftmove and chrisgarcia4158 and unassigned leftmove Mar 12, 2024
@leftmove leftmove added the bug Something isn't working label Mar 12, 2024
@chrisgarcia4158
Copy link
Collaborator

chrisgarcia4158 commented Mar 12, 2024

Potential average aggregation query.

db.statistics.aggregate(
   [
     {
       $group:
         {
           _id: "$type",
           avg: { $avg: { $divide: [ { $size: "$log.logs" }, "$log.time.elapsed" ] } }
         }
     }
   ]
)

@chrisgarcia4158
Copy link
Collaborator

Results for query.

{ "_id" : "create-historical", "avg" : 14.349005705254921 }
{ "_id" : "create-latest", "avg" : 17.308616566972628 }

Historical queries do about 14 per second and latest queries do about 17 per second. In order to create an accurate estimation, take stock count, multiply it by two, and add four. I've added some more accurate code to the add_query_log function, but until that collects enough statistics this will have to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants