New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 779635 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Potential inefficiency in UKM Mojo API

Project Member Reported by mfomitchev@chromium.org, Oct 30 2017

Issue description

Every call to MojoUkmRecorder::AddEntry results in a separate a cross-process mojo call. It seems like this can get pretty expensive, especially if a lot of clients start using this API. 

It would probably be better to use a "pull" approach rather than the "push" approach for the UKM data, where the UKM service would pull data from the clients in bulk every once in a while. This is the approach UMA uses.

WDYT?
 
Cc: holte@chromium.org
+holte@
Components: Internals>Metrics

Comment 3 by holte@chromium.org, Nov 1 2017

I think it may make sense add something for sending data in batches.  I think this is probably less important than for UMA since the UKM data is not aggregated on the client, so this is mainly a number of calls thing.  I think in some cases, we might need to be careful about how process shutdown is handled, and we may need to have some analog of PersistentHistograms to store data until it has been received by the UkmService.

Comment 4 by holte@chromium.org, Nov 1 2017

Components: -Internals>Metrics Internals>Metrics>UKM
Sorry, what do you mean when you say the UKM data is not aggregated on the client? Is there a reason we can't make a UkmRecorder implementation that aggregates data from the clients, and then have the UkmService pull it - similar to how UMA works?

Comment 6 by holte@chromium.org, Nov 3 2017

I mean that if you have some UMA histogram like
UMA_HISTOGRAM_COUNTS("XYZ", value), and you record a million values to it UMA will still only send a count for each of the 50 buckets.

If you record a million events like 
ukm::builders::XYZ(source_id)
  .setX(x)
  .setY(y)
  .record(recorder);

UKM would conceptually want to send a million (source_id, x, y) tuples.  In practice, this would actually be truncated, and metrics that record too frequently are expected to sample to avoid hitting the truncation limit.  I think you are likely to run into problems with our bandwidth throttling before you hit performance costs from mojo calls.  Also, you'd still have to send all of the data process with the UkmService so that it can upload it.
Ah, I see. Yeah, I guess with sampling it's not an issue now considering we are only going to be reporting scroll latency cross-ipc. If we ever get to a point where we have a large number of different UKM sources reporting cross-process, this will increase in priority.
Status: Assigned (was: Untriaged)

Sign in to add a comment