Commit Graph

32 Commits

Author SHA1 Message Date
Klaas van Schelven
a54ec29433 Reraise rather than assert-for-nonexception
this expresses more clearly what the intention is, and the result is more clear too
(one less level of exception-chaining)
2025-01-17 17:04:20 +01:00
Klaas van Schelven
f2a78fed9d Use the envelope's event_id when using the envelope endpoint
* As per the spec 'takes precendence'
* Also fixes the reported bug on Laravel, which apparently doesn't send event_id
  as part of the event payload.
* Fixes the envelope tests (they were doing nothing when I moved the
  data samples around recently)
* Adds a 'no event_id in data, but yes in envelope' test to that test.
* Adds handling to send_json such that we can send envelopes when the event_id
  is missing from the event data.
2024-09-18 11:36:47 +02:00
Klaas van Schelven
ff618099dc event-model TODOs: reorganize and reflect that these are not TODOs for now 2024-09-13 09:51:30 +02:00
Klaas van Schelven
b76e474ef1 Navigation: fix for missing events
Now that we have eviction, events may disappear. Deal with it:

* event-specific 404 that still allows for navigation
* first/last buttons
* navigation to prev/next when prev/next is not just 1 step away
* don't use HttpRedirect for "lookup based" views
    in principle, the thing you were looking for might go missing in-between
    drawback: these URLs are not "stable"
2024-07-19 11:03:08 +02:00
Klaas van Schelven
3128392d9a Distinguish ingested_at and digested_at 2024-07-18 14:45:59 +02:00
Klaas van Schelven
c01d332e18 Rename ingest_order to digest_order and clarify event_count
* issue.event_count to digested_event_count
* event.ingest_order to event.digest_order
* issue.ingest_order to digest_order

This is generally more correct/explicit, and is also in preparation
of doing work on-digest (which may or may not happen)
2024-07-16 15:23:40 +02:00
Klaas van Schelven
93365f4c8d Period-counting using SQL instead of custom-made (PoC)
The direct cause for this was the following observation: there was no mechanism
in place to safeguard counted events across evictions, i.e. the following order
of events was not accounted for:

* ingest/digest a bunch of events (PCs correctly updated)
* eviction (PC still correct)
* server/snappea restart (PC reloaded, but based on new events. not correct).

I though about various approaches to fix this (e.g. snapshotting) but in the end
such approaches added even more complexity to the PC mechanism. I decided to first
check how non-performant the SQL route would be, and this PoC seems to say: just
go SQL.

There's also a small semantic change (probably in the direction of what you'd
expect), namely: the periods are no longer 'calendar' periods.
2024-07-15 14:28:13 +02:00
Klaas van Schelven
fe6c955465 never_evict events that are a Historic Turning Point
Both for technical (foreign keys) and business reasons (these are events you
care about)
2024-06-24 22:50:00 +02:00
Klaas van Schelven
adda019cef Add an index to the Event model for eviction
Unscientifically (n=1, changing circumstances), this improved times like so when the max was 10k:

* 573.56ms EVICT; down to 8813, max irr. from 15 to 13 in 171ms+402ms and 5+4 queries  (pre-index)
* 229.34ms EVICT; down to 7643, max irr. from 15 to 12 in 7ms+222ms and 5+7 queries    (post-index)

The order of the index was chosen because we have 3 types of queries in our algo:

* on Project -> irrelevance <= amount of work
* on Project, timestamp -> irrelevance <= observed irrelevances
* on Project, timestamp, irrelevance -> deletion
2024-06-24 14:29:01 +02:00
Klaas van Schelven
ea6aa9bbca Retention/quotas: something that 'seems to work' (doesn't immediately crash) 2024-06-21 11:50:13 +02:00
Klaas van Schelven
c2b821589d Retention, WIP (yesterday) 2024-06-21 09:28:04 +02:00
Klaas van Schelven
58435754e0 Digest immediately implemented 2024-04-26 14:48:07 +02:00
Klaas van Schelven
f098802fde Event already exists: return 400; implement with one less query 2024-04-11 11:03:41 +02:00
Klaas van Schelven
4dfefec468 denormalize/cache last_frame_* and transaction on Event and Issue
for performance, but also fixes:

* not just the 'last frame' but the 'last relevant frame' (in-app)
* truncation is properly done (matching the DB size, and for each of the fields)
2024-04-10 09:12:15 +02:00
Klaas van Schelven
ba6b158848 Fix on previous commit (wrong unique index) 2024-04-10 08:54:58 +02:00
Klaas van Schelven
d46cb7f6e8 DB: unique_together and PositiveIntegerField 2024-04-09 12:34:29 +02:00
Klaas van Schelven
82b8c014e7 Add title to event-details 2024-04-09 09:39:50 +02:00
Klaas van Schelven
1b37298a95 ingest_order: first setup 2024-04-08 22:13:52 +02:00
Klaas van Schelven
652823f8c3 Store calculated type and value on issue and event and use these values in the templates 2024-04-08 15:30:41 +02:00
Klaas van Schelven
d94bfa8aa6 Log Messages: my first take
they should somehow show up in the title; in the interface it should be clear that we're
dealing with log messages (rather than exceptions)
2024-04-04 15:40:31 +02:00
Klaas van Schelven
fea9d5a90d Push comments into help-text 2024-03-30 21:02:26 +01:00
Klaas van Schelven
9936c93b4e Events <-> RawEvents FK 2024-01-07 22:39:56 +01:00
Klaas van Schelven
186ddb62cf Event.from_ingested 2024-01-07 22:31:07 +01:00
Klaas van Schelven
6a27a248af Split up ingest/digest (and have a test for process_event) 2024-01-07 22:09:38 +01:00
Klaas van Schelven
94661b4bb8 Swap FK event<->issue 2024-01-05 22:38:59 +01:00
Klaas van Schelven
e3433e8ddb server-side timestamp fixes (untested) 2024-01-05 20:40:41 +01:00
Klaas van Schelven
89cab4f3c8 WIP: midway checkin in the PeriodCounter registry stuff 2024-01-05 20:20:14 +01:00
Klaas van Schelven
be845ec393 Links from/to the admin 2023-11-17 22:45:16 +01:00
Klaas van Schelven
c054b48a4b Download and raw links 2023-11-13 18:35:29 +01:00
Klaas van Schelven
725822ce3d Events: some modelling and a command to ingest JSONs from other projects as examples 2023-11-11 21:13:15 +01:00
Klaas van Schelven
238fb6dda7 Event as a Django model (first version) 2023-11-11 12:33:37 +01:00
Klaas van Schelven
1a5bf7d56c The ugliest thing that could get a stacktrace on screen 2023-11-04 21:02:04 +01:00