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

Implement the "Underutilized network time" metric #4901

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hy9be
Copy link
Contributor

@hy9be hy9be commented Oct 26, 2024

Implement the "Underutilized network time" metric proposed in #4858

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 58.82353% with 14 lines in your changes missing coverage. Please review.

Project coverage is 64.37%. Comparing base (491ac04) to head (c1b3a1f).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/util/performance.ts 47.82% 11 Missing and 1 partial ⚠️
src/source/worker_tile.ts 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (491ac04) and HEAD (c1b3a1f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (491ac04) HEAD (c1b3a1f)
9 8
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4901       +/-   ##
===========================================
- Coverage   87.99%   64.37%   -23.63%     
===========================================
  Files         265      265               
  Lines       37974    38007       +33     
  Branches     2409     1570      -839     
===========================================
- Hits        33417    24468     -8949     
- Misses       3490    12620     +9130     
+ Partials     1067      919      -148     

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

@@ -359,6 +360,10 @@ export class HandlerManager {
}

handleEvent = (e: Event, eventName?: keyof Handler) => {
if (e.type === 'moveend' || e.type === 'zoomend' || e.type === 'rotateend') {
Copy link
Collaborator

@HarelM HarelM Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollend? pitchend? bearingend?

@@ -160,6 +161,7 @@ export class WorkerTile {
getPatternsPromise = actor.sendAsync({type: MessageType.getImages, data: {icons: patterns, source: this.source, tileID: this.tileID, type: 'patterns'}}, abortController);
}

PerformanceUtils.mark(PerformanceMarkers.glyphsRequested);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this happens in the worker thread, not sure you reach it in the main thread...?

@@ -173,8 +174,11 @@ export class SourceCache extends Evented {
}

async _loadTile(tile: Tile, id: string, state: TileState): Promise<void> {
PerformanceUtils.mark(PerformanceMarkers.lastTileRequested);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this add some tileId data to the performance?

@HarelM
Copy link
Collaborator

HarelM commented Oct 26, 2024

Thanks for taking the time to open this PR!
It's worth checking if the release build (not dev) has these performance hook as I seem to remember these are stripped out before packing.
In general, I would consider using fire(...) instead of the performance utils somehow to allow people listen to the relevant events with the relevant data and measure performance as needed, maybe, IDK...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants