EDSC-4613: Build metrics for how long it takes for the map to load - #2083
Open
eudoroolivares2016 wants to merge 12 commits into
Open
EDSC-4613: Build metrics for how long it takes for the map to load#2083eudoroolivares2016 wants to merge 12 commits into
eudoroolivares2016 wants to merge 12 commits into
Conversation
Bundle Size ComparisonFull build detailsThe full bundle is larger than main by 2.27 kB. ❗ The index.js is larger than main by 0.19 kB. ❗ Run
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2083 +/- ##
==========================================
+ Coverage 95.84% 95.85% +0.01%
==========================================
Files 756 756
Lines 17776 17867 +91
Branches 4978 5049 +71
==========================================
+ Hits 17037 17127 +90
- Misses 687 688 +1
Partials 52 52 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
eudoroolivares2016
force-pushed
the
EDSC-4613
branch
from
August 21, 2026 15:43
340baab to
a6a030a
Compare
…ithout a collection
eudoroolivares2016
force-pushed
the
EDSC-4613
branch
from
August 21, 2026 21:47
a6a030a to
2f75264
Compare
eudoroolivares2016
marked this pull request as ready for review
August 24, 2026 14:23
eudoroolivares2016
requested review from
macrouch,
mandyparson,
stephenkilbourn and
trevorlang
August 28, 2026 17:47
| collectionId: string | ||
| ) => { | ||
| dataLayer.push({ | ||
| event: 'map', |
Contributor
Author
There was a problem hiding this comment.
We want:
zoomLevel, center
Contributor
Author
There was a problem hiding this comment.
call imagery rather than "granule backgrounds"
| windowDurationMs: number | ||
| } | ||
|
|
||
| export const metricsMapFramePerformance = (event: MapPerformanceEvent) => { |
Contributor
Author
There was a problem hiding this comment.
number of granules
| let previousGranulesKey: string | ||
| let previousProjectionCode: ProjectionCode | ||
| let layersAdded = false | ||
| const PERFORMANCE_WINDOW_MS = 3000 |
Contributor
Author
There was a problem hiding this comment.
This should be a bamboo var
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
What is the feature?
Creates three events for the map to track
Performance of the granule outlines, background, and a performance indicator for the sluggishness of the map.
This also fixes the main issue by cleaning up accumulating listener objects from the interface and some minor improvements by just bailing out before extra processing is done
What is the Solution?
For the granule performance metrics we can just listen for the postrender events that openlayers producers collect them and then send that to the dataLayer GTM event middleware. Within these events we are also bucketing users based on granule count. This is so that we can get an idea of how many granules users are observing at a time as we may decide to cap that amount.
For the "FPS" timing: we create a timer for a configurable length proposing 3 minutes and use that in conjunction to a listener on MoveEnd events. This is so that we don't collect stats for when people aren't moving the map. The idea is to understand how fast/slow the map moves for users. When a move-end occurs and the time has passed we divide up that metric into percentiles so its easier for us to use this metrics on the analytics side.
The main performance improvement in this PR is the useEffect at the end this is just cleaning up the granule outline listeners which were accumulating and causing the slowdown. There are a few other improvements based on console.counts appearing e.g. calls that don't need to happen
What areas of the application does this impact?
Map.jsx and data layer metrics
Testing
Reproduction steps
C1701805625-GES_DISC - granule with many data layers
C2259345545-GES_DISC - main issue one; complex granule vertices
C3104974973-SEDAC - simple use-case; control
Attachments
C2259345545-GES_DISC - without the use-effect cleanup

C2259345545-GES_DISC - after the use-effect cleanup

Checklist
npm audit fixand made note of any changes in this PR