Commit 3dca9f1b authored by yurys@chromium.org's avatar yurys@chromium.org

Support counter graphs in Timeline based on trace events

BUG=361045

Review URL: https://codereview.chromium.org/337123002

git-svn-id: svn://svn.chromium.org/blink/trunk@176228 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a37b38f3
...@@ -410,7 +410,7 @@ void V8GCController::gcEpilogue(v8::GCType type, v8::GCCallbackFlags flags) ...@@ -410,7 +410,7 @@ void V8GCController::gcEpilogue(v8::GCType type, v8::GCCallbackFlags flags)
} }
TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "GCEvent", "usedHeapSizeAfter", usedHeapSize(isolate)); TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "GCEvent", "usedHeapSizeAfter", usedHeapSize(isolate));
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "", InspectorUpdateCountersEvent::data()); TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", "data", InspectorUpdateCountersEvent::data());
} }
void V8GCController::minorGCEpilogue(v8::Isolate* isolate) void V8GCController::minorGCEpilogue(v8::Isolate* isolate)
......
...@@ -69,9 +69,9 @@ WebInspector.MemoryCountersGraph.prototype = { ...@@ -69,9 +69,9 @@ WebInspector.MemoryCountersGraph.prototype = {
*/ */
function addStatistics(record) function addStatistics(record)
{ {
if (record.type() !== WebInspector.TimelineModel.RecordType.UpdateCounters) var counters = record.counters();
if (!counters)
return; return;
var counters = record.data();
for (var name in counters) { for (var name in counters) {
var counter = this._countersByName[name]; var counter = this._countersByName[name];
if (counter) if (counter)
......
...@@ -68,10 +68,8 @@ WebInspector.TimelineMemoryOverview.prototype = { ...@@ -68,10 +68,8 @@ WebInspector.TimelineMemoryOverview.prototype = {
*/ */
function calculateMinMaxSizes(record) function calculateMinMaxSizes(record)
{ {
if (record.type() !== WebInspector.TimelineModel.RecordType.UpdateCounters) var counters = record.counters();
return; if (!counters || !counters.jsHeapSizeUsed)
var counters = record.data();
if (!counters.jsHeapSizeUsed)
return; return;
maxUsedHeapSize = Math.max(maxUsedHeapSize, counters.jsHeapSizeUsed); maxUsedHeapSize = Math.max(maxUsedHeapSize, counters.jsHeapSizeUsed);
minUsedHeapSize = Math.min(minUsedHeapSize, counters.jsHeapSizeUsed); minUsedHeapSize = Math.min(minUsedHeapSize, counters.jsHeapSizeUsed);
...@@ -92,10 +90,8 @@ WebInspector.TimelineMemoryOverview.prototype = { ...@@ -92,10 +90,8 @@ WebInspector.TimelineMemoryOverview.prototype = {
*/ */
function buildHistogram(record) function buildHistogram(record)
{ {
if (record.type() !== WebInspector.TimelineModel.RecordType.UpdateCounters) var counters = record.counters();
return; if (!counters || !counters.jsHeapSizeUsed)
var counters = record.data();
if (!counters.jsHeapSizeUsed)
return; return;
var x = Math.round((record.endTime() - minTime) * xFactor); var x = Math.round((record.endTime() - minTime) * xFactor);
var y = Math.round((counters.jsHeapSizeUsed - minUsedHeapSize) * yFactor); var y = Math.round((counters.jsHeapSizeUsed - minUsedHeapSize) * yFactor);
......
...@@ -410,6 +410,11 @@ WebInspector.TimelineModel.Record.prototype = { ...@@ -410,6 +410,11 @@ WebInspector.TimelineModel.Record.prototype = {
*/ */
type: function() { }, type: function() { },
/**
* @return {?Object}
*/
counters: function() { },
/** /**
* @return {string} * @return {string}
*/ */
......
...@@ -479,6 +479,14 @@ WebInspector.TimelineModel.RecordImpl.prototype = { ...@@ -479,6 +479,14 @@ WebInspector.TimelineModel.RecordImpl.prototype = {
return this._record.type; return this._record.type;
}, },
/**
* @return {?Object}
*/
counters: function()
{
return this.type() === WebInspector.TimelineModel.RecordType.UpdateCounters ? this.data() : null;
},
/** /**
* @return {?Object} * @return {?Object}
*/ */
......
...@@ -816,8 +816,10 @@ WebInspector.TimelinePanel.prototype = { ...@@ -816,8 +816,10 @@ WebInspector.TimelinePanel.prototype = {
this._lazyFrameModel.addRecords(this._model.records()); this._lazyFrameModel.addRecords(this._model.records());
} }
} }
if (this._tracingTimelineModel) if (this._tracingTimelineModel) {
this.requestWindowTimes(this._tracingTimelineModel.minimumRecordTime(), this._tracingTimelineModel.maximumRecordTime());
this._refreshViews(); this._refreshViews();
}
this._hideProgressPane(); this._hideProgressPane();
}, },
......
...@@ -604,6 +604,14 @@ WebInspector.TracingTimelineModel.TraceEventRecord.prototype = { ...@@ -604,6 +604,14 @@ WebInspector.TracingTimelineModel.TraceEventRecord.prototype = {
return this._event.name; return this._event.name;
}, },
/**
* @return {?Object}
*/
counters: function()
{
return this.type() === WebInspector.TracingTimelineModel.RecordType.UpdateCounters ? this._event.args.data : null;
},
/** /**
* @return {?Object} * @return {?Object}
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment