Usage data/scrape to n
Created by: coury-clark
Closes https://github.com/sourcegraph/sourcegraph/issues/39087 Part of RFC 719
Scrape the event_log
table up to N, where N defaults to 5000 and is overridable with a setting.
Test plan
Integration tests in this PR, and manually tested:
[ worker] INFO worker.export-usage-telemetry telemetry/telemetry_job.go:101 telemetryHandler executed {"event count": 5000, "maxId": 17542}
After setting batchSize to 10
[ worker] INFO worker.export-usage-telemetry telemetry/telemetry_job.go:101 telemetryHandler executed {"event count": 10, "maxId": 12552}