-
Notifications
You must be signed in to change notification settings - Fork 11
Ticket Alert Mechanism
Jack Li edited this page Oct 16, 2022
·
3 revisions
- Follow the Ticket Storage design at wiki page.
- Alert handling is asynchronous action and is triggered when updating the
best_available_seatsandbest_history_seatscollections. A queue is constructed to schedule the alert handlers.
- Let
Abe the list of current best available seats andBthe list of new best available seats. - Query list
AandBby scraping_id from the database. - Compute
C := A-Bwhich is the seats based on the comparator should check for (sec, row?, seat?, price). - Compute
D := B-Awhich is the new seats. - Remove
Cfrombest_available_seatsand insertDtobest_available_seats. - Save
Ctobest_history_seats. - Use
Dto invoke a handler to analyze them against thebest_history_seatsasynchronously.
- Query the collection
best_history_seatswith some filter. - Find the percentile of the seat based on some criteria (e.g. rank or price).
- If found the exact same seat based on (sec, row?, seat?), get the history price(s) of the seat.
- Alert the user based on alert conditions
Calculation
- % change = (new_price - min) / (max-min) or (max - new_price) / (max-min)
Calculation
- percentile = new_price_rank / total_count_of_history_seats
Example
- If there are
r1number of history tickets whose prices <= new price andtotalthe total count of history tickets, then the percentile =r1/total.
If the two thresholds are low, the alerting is less sensitive, meaning the tracker will be less frequent to send price alerts to users.
= 0.5
Example
min = $100, max = $200, the threshold will be met when the price is <= $150.
= 0.5 (i.e. the median)
Precondition:
- In comparison to the new seat, tickets in
best_history_seatsthat shared a similar price (>= new ticket price) and have a lower rank have been found.
Main Success Scenario:
- Alert user of a
rank increasewith new and old prices and the percentile.
Precondition:
- In comparison to the new seat, tickets in
best_history_seatsthat shared a similar price (<= new ticket price) and have a higher rank have been found.
Main Success Scenario:
- Alert user of a
rank dropwith new and old prices and the percentile.
Precondition:
- In comparison to the new seat, tickets in
best_history_seatsthat shared a similar rank (<= new ticket rank) and have a higher price have been found. - i.e. Found a lower price of seats than those of the same viewing experience (rank).
Main Success Scenario:
- Alert user of a
price dropwith alternative seat (new) price, old prices in the neighborhood of the spot located from querying, and the percentile.
Precondition:
- In comparison to the new seat, tickets in
best_history_seatsthat shared a similar rank (>= new ticket rank) and have a lower price have been found. - i.e. Found a higher price of seats than those of the same viewing experience (rank).
Main Success Scenario:
- Alert user of a
price increasewith alternative seat (new) price, old prices in the neighborhood of the spot located from querying, and the percentile.