Skip to content

Commit

Permalink
cc: Add analysis time to telemetry
Browse files Browse the repository at this point in the history
Added average per tile analysis time to smoothness
measurement.

Review URL: https://chromiumcodereview.appspot.com/15557003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201647 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
vmpstr@chromium.org committed May 23, 2013
1 parent 82ae813 commit c9f0d06
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cc/debug/rendering_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void RenderingStats::EnumerateFields(Enumerator* enumerator) const {
total_deferred_image_decode_time.InSecondsF());
enumerator->AddDouble("totalImageGatheringTimeInSeconds",
total_image_gathering_time.InSecondsF());
enumerator->AddDouble("totalTileAnalysisTimeInSeconds",
total_tile_analysis_time.InSecondsF());
}

void RenderingStats::Add(const RenderingStats& other) {
Expand Down Expand Up @@ -91,6 +93,7 @@ void RenderingStats::Add(const RenderingStats& other) {
total_image_gathering_time += other.total_image_gathering_time;
total_tiles_analyzed += other.total_tiles_analyzed;
solid_color_tiles_analyzed += other.solid_color_tiles_analyzed;
total_tile_analysis_time += other.total_tile_analysis_time;
}

} // namespace cc
1 change: 1 addition & 0 deletions cc/debug/rendering_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct CC_EXPORT RenderingStats {
int64 solid_color_tiles_analyzed;
base::TimeDelta total_deferred_image_decode_time;
base::TimeDelta total_image_gathering_time;
base::TimeDelta total_tile_analysis_time;
// Note: when adding new members, please remember to update EnumerateFields
// and Add in rendering_stats.cc.

Expand Down
5 changes: 4 additions & 1 deletion cc/debug/rendering_stats_instrumentation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,15 @@ void RenderingStatsInstrumentation::IncrementDeferredImageCacheHitCount() {
rendering_stats_.total_deferred_image_cache_hit_count++;
}

void RenderingStatsInstrumentation::AddTileAnalysisResult(bool is_solid_color) {
void RenderingStatsInstrumentation::AddTileAnalysisResult(
base::TimeDelta duration,
bool is_solid_color) {
if (!record_rendering_stats_)
return;

base::AutoLock scoped_lock(lock_);
rendering_stats_.total_tiles_analyzed++;
rendering_stats_.total_tile_analysis_time += duration;
if (is_solid_color)
rendering_stats_.solid_color_tiles_analyzed++;
}
Expand Down
2 changes: 1 addition & 1 deletion cc/debug/rendering_stats_instrumentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class CC_EXPORT RenderingStatsInstrumentation {

void IncrementDeferredImageCacheHitCount();

void AddTileAnalysisResult(bool is_solid_color);
void AddTileAnalysisResult(base::TimeDelta duration, bool is_solid_color);

protected:
RenderingStatsInstrumentation();
Expand Down
5 changes: 4 additions & 1 deletion cc/resources/tile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -903,12 +903,15 @@ void TileManager::RunAnalyzeTask(
DCHECK(analysis);
DCHECK(stats_instrumentation);

base::TimeTicks start_time = stats_instrumentation->StartRecording();
picture_pile->AnalyzeInRect(rect, contents_scale, analysis);
base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);

// Record the solid color prediction.
UMA_HISTOGRAM_BOOLEAN("Renderer4.SolidColorTilesAnalyzed",
analysis->is_solid_color);
stats_instrumentation->AddTileAnalysisResult(analysis->is_solid_color);
stats_instrumentation->AddTileAnalysisResult(duration,
analysis->is_solid_color);

// Clear the flag if we're not using the estimator.
analysis->is_solid_color &= use_color_estimator;
Expand Down
9 changes: 9 additions & 0 deletions tools/perf/perf_tools/smoothness_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,22 @@ def CalcAnalysisResults(rendering_stats_deltas, results):
'totalTilesAnalyzed', 0)
solidColorTilesAnalyzed = rendering_stats_deltas.get(
'solidColorTilesAnalyzed', 0)
totalTileAnalysisTimeInSeconds = rendering_stats_deltas.get(
'totalTileAnalysisTimeInSeconds', 0)

averageAnalysisTimeMS = \
1000 * DivideIfPossibleOrZero(totalTileAnalysisTimeInSeconds,
totalTilesAnalyzed)

results.Add('total_tiles_analyzed', 'count',
totalTilesAnalyzed,
data_type='unimportant')
results.Add('solid_color_tiles_analyzed', 'count',
solidColorTilesAnalyzed,
data_type='unimportant')
results.Add('average_tile_analysis_time', 'ms',
averageAnalysisTimeMS,
data_type='unimportant')

class SmoothnessMeasurement(page_measurement.PageMeasurement):
def __init__(self):
Expand Down

0 comments on commit c9f0d06

Please sign in to comment.