Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deduplication of metrics #20

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

desusai7
Copy link
Contributor

@desusai7 desusai7 commented Oct 27, 2023

Update database for storing batches

  • Create Model classes for snapshot table
  • Create a new table for storing snapshots of batches.
  • Provide APIs for fetching and storing in the database

take a snapshot of metrics at regular intervals as batches and assign random UUID

  • Take a snapshot of the metrics table at regular intervals.
  • Create a batch JSON from the same.
  • Assign a random UUID to the batch JSON
  • Use reservoir API to store the same.

syncing batches with server

  • Whenever a batch is pushed, try syncing it with the server.
  • At regular intervals fetch batches from the jobs table (if any)
  • Send the batches to the server
  • If successful remove the batches.

@desusai7 desusai7 self-assigned this Oct 27, 2023
@desusai7 desusai7 added the WIP label Oct 27, 2023
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6d61209) 0.00% compared to head (8d00b21) 0.00%.

❗ Current head 8d00b21 differs from pull request most recent head 670b13f. Consider uploading reports for the commit 670b13f to get more accurate results

Additional details and impacted files
@@     Coverage Diff      @@
##   master   #20   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@desusai7 desusai7 marked this pull request as ready for review October 30, 2023 07:14
@desusai7 desusai7 requested a review from pallabmaiti as a code owner October 30, 2023 07:14
@desusai7 desusai7 requested a review from itsdebs October 30, 2023 07:16
@desusai7 desusai7 added DO NOT MERGE Approved but need to check more and removed Ready for Review labels Nov 22, 2023
desusai7 and others added 2 commits November 22, 2023 11:02
* feat: added batch generator to generate batches periodically

* chore: updated sample app to be debuggable and added new files to the project

* refactor: made changes to make BatchOperator and BatchGenerator unit-testable

* test: fixed failing unit tests in DatabaseTests, MetricOperatorTests after enhancements in MetricOperator

* test: added unit tests for batch generator

* chore: fixed merge issues and changes as required

* fix: updated snapshot generator timer to a default of 30 seconds and deleting metrics and errors only on successful batch generation

* fix: minor changes

* chore: extended Plugin protocol to create MetricsPlugin which contains execute

* chore: changed crashreporter and snapshotgenerators from plugins to managers

* test: fixed failing unit tests after changing CrashReporter, SnapshotGenerator to managers from plugins

* feat: syncing batches with server (#24)

* feat: added functions to get and clear batches in database

* feat: added database observer to be notified about the changes to the db

* chore: minor improvements in the ServiceManager

* feat: added batch uploader to sync batches to metrics service

* feat: added support for retrying with backoff when requests to metrics service get failed

* chore: renamed batch to snapshot

* chore: uploading snapshots on saving new snapshot

* chore: added error handling to database observer

* feat: added atomic property wrapper for synchronized across across threads

* refactor: converted snapshot uploader to a manager and initialized it in snapshot generator

* chore: minor changes

---------

Co-authored-by: Desu Sai Venkat <[email protected]>
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

89.0% 89.0% Coverage
6.4% 6.4% Duplication

@desusai7 desusai7 changed the title feat: update database for storing batches feat: deduplication of metrics Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE Approved but need to check more
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants