Related: cool#8063 add a debugging metric for 'new tiles %' of all tiles+deltas

https: //github.com/CollaboraOnline/online/pull/8063
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia754df62b697251e76076f39f4780784b3289dfc
pull/8072/head
Caolán McNamara 2024-01-22 20:31:20 +00:00 committed by Michael Meeks
parent 33310613cd
commit 4772c0f6c2
1 changed files with 14 additions and 8 deletions

View File

@ -5140,8 +5140,11 @@ L.CanvasTileLayer = L.Layer.extend({
this._debugInvalidateCount + ', recv-tiles: ' + this._debugLoadTile +
', recv-delta: ' + this._debugLoadDelta +
', recv-update: ' + this._debugLoadUpdate);
var allDeltas = this._debugLoadDelta + this._debugLoadUpdate;
this._debugData['nullUpdateMetric'].setPrefix('<b>Tile update waste: ' +
Math.round(100.0 * this._debugLoadUpdate / (this._debugLoadDelta + this._debugLoadUpdate)) + '%</b>');
Math.round(100.0 * this._debugLoadUpdate / allDeltas) + '%</b>');
this._debugData['newTileMetric'].setPrefix('<b>New Tile ratio: ' +
Math.round(100.0 * this._debugLoadTile / (allDeltas + this._debugLoadTile)) + '%</b>');
},
_addDebugTool: function (tool) {
@ -5184,14 +5187,17 @@ L.CanvasTileLayer = L.Layer.extend({
startsOn: true,
onAdd: function () {
self._debugData = {};
self._debugDataNames = ['canonicalViewId', 'tileCombine', 'fromKeyInputToInvalidate', 'ping', 'loadCount', 'postMessage'];
for (var i = 0; i < self._debugDataNames.length; i++) {
self._debugData[self._debugDataNames[i]] = L.control.attribution({prefix: '', position: 'bottomleft'}).addTo(self._map);
self._debugData[self._debugDataNames[i]].addTo(self._map);
var _debugDataNames = ['canonicalViewId', 'tileCombine', 'fromKeyInputToInvalidate', 'ping', 'loadCount', 'postMessage'];
for (var i = 0; i < _debugDataNames.length; i++) {
self._debugData[_debugDataNames[i]] = L.control.attribution({prefix: '', position: 'bottomleft'}).addTo(self._map);
self._debugData[_debugDataNames[i]].addTo(self._map);
}
_debugDataNames = ['nullUpdateMetric', 'newTileMetric'];
for (var i = 0; i < _debugDataNames.length; i++) {
self._debugData[_debugDataNames[i]] = L.control.attribution({prefix: '', position: 'topleft'}).addTo(self._map);
self._debugData[_debugDataNames[i]].addTo(self._map);
self._debugData[_debugDataNames[i]]._container.style.fontSize = '14px';
}
self._debugData['nullUpdateMetric'] = L.control.attribution({prefix: '', position: 'topleft'}).addTo(self._map);
self._debugData['nullUpdateMetric'].addTo(self._map);
self._debugData['nullUpdateMetric']._container.style.fontSize = '14px';
},
onRemove: function () {
for (var i in self._debugData) {