sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Metrics clean

Open stefanosiano opened this issue 1 year ago • 1 comments

:scroll: Description

  • Remove timestampMs from LocalMetricsAggregator
  • put toStatsdType in enum directly
  • beforeMetric wrapped in try catch
  • flush check if there are metrics before scheduling again

:bulb: Motivation and Context

Just a small cleanup of the metrics code

:green_heart: How did you test it?

:pencil: Checklist

  • [ ] I reviewed the submitted code.
  • [ ] I added tests to verify the changes.
  • [ ] No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • [ ] I updated the docs if needed.
  • [ ] Review from the native team if needed.
  • [ ] No breaking change or entry added to the changelog.
  • [ ] No breaking change for hybrid SDKs or communicated to hybrid SDKs.

:crystal_ball: Next steps

stefanosiano avatar May 02 '24 08:05 stefanosiano

Performance metrics :rocket:

  Plain With Sentry Diff
Startup time 369.76 ms 454.18 ms 84.42 ms
Size 1.70 MiB 2.28 MiB 592.15 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0810952c95d04ff7e1b4be22b386cec9c79016d4 364.51 ms 468.08 ms 103.57 ms
61981dc1039b766300d6e38e82ccacb439387cb7 388.65 ms 454.96 ms 66.31 ms
baaf6371cb120f45ad4fed59e8b97e65e3381cfd 428.12 ms 520.40 ms 92.28 ms
1ae2ec606b8151dc0fe7fca19b4ed041b47840c0 353.85 ms 419.71 ms 65.85 ms
c7e2fbc59ddc599ea7fe0bf4cd1e11a9e34722af 377.85 ms 426.35 ms 48.50 ms
b172d4ed57bfa46dfac6bee0216bea7d0126b253 412.60 ms 492.68 ms 80.08 ms
4e260b39672c0cc6383209cec9f3300ac5596e36 378.73 ms 454.18 ms 75.45 ms
93a76ca3ed5e22b37a521784f4b601668bfa7e07 377.41 ms 448.22 ms 70.81 ms
93a76ca3ed5e22b37a521784f4b601668bfa7e07 381.08 ms 459.22 ms 78.14 ms
7b7964f423f45db68b01e66b1b6ce08dacb3e7b6 363.27 ms 455.32 ms 92.05 ms

App size

Revision Plain With Sentry Diff
0810952c95d04ff7e1b4be22b386cec9c79016d4 1.72 MiB 2.27 MiB 558.21 KiB
61981dc1039b766300d6e38e82ccacb439387cb7 1.70 MiB 2.28 MiB 592.12 KiB
baaf6371cb120f45ad4fed59e8b97e65e3381cfd 1.72 MiB 2.27 MiB 558.42 KiB
1ae2ec606b8151dc0fe7fca19b4ed041b47840c0 1.70 MiB 2.27 MiB 584.63 KiB
c7e2fbc59ddc599ea7fe0bf4cd1e11a9e34722af 1.72 MiB 2.29 MiB 576.40 KiB
b172d4ed57bfa46dfac6bee0216bea7d0126b253 1.72 MiB 2.29 MiB 578.09 KiB
4e260b39672c0cc6383209cec9f3300ac5596e36 1.72 MiB 2.27 MiB 554.95 KiB
93a76ca3ed5e22b37a521784f4b601668bfa7e07 1.72 MiB 2.29 MiB 576.75 KiB
93a76ca3ed5e22b37a521784f4b601668bfa7e07 1.72 MiB 2.29 MiB 576.75 KiB
7b7964f423f45db68b01e66b1b6ce08dacb3e7b6 1.70 MiB 2.28 MiB 592.12 KiB

Previous results on branch: enh/metrics-cleanup

Startup times

Revision Plain With Sentry Diff
4c051c48eee6566ce463284dfdb64179e6f1e5f9 331.11 ms 426.71 ms 95.60 ms
82ddb6c98556369579164e6d6bc4b9552a4170f2 474.15 ms 570.88 ms 96.73 ms

App size

Revision Plain With Sentry Diff
4c051c48eee6566ce463284dfdb64179e6f1e5f9 1.70 MiB 2.28 MiB 591.96 KiB
82ddb6c98556369579164e6d6bc4b9552a4170f2 1.70 MiB 2.28 MiB 591.96 KiB

github-actions[bot] avatar May 02 '24 08:05 github-actions[bot]