Bug 1650336 - Add the session id to the WebconsoleAddMessages marker label r=nchevobbe

An issue with the current approach is that labels are a bit too big for the marker chart sidebar in the profiler UI.
An issue was filed to address this at https://github.com/firefox-devtools/profiler/issues/2638

Differential Revision: https://phabricator.services.mozilla.com/D82772
This commit is contained in:
Julian Descottes 2020-07-09 16:36:18 +00:00
parent 77c7ad6ffa
commit 7b9705ac23
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ const { Cu } = require("chrome");
* Performance marker middleware is responsible for recording markers visible
* performance profiles.
*/
function performanceMarkerMiddleware(store) {
function performanceMarkerMiddleware(sessionId, store) {
return next => action => {
const shouldAddProfileMarker = action.type === MESSAGES_ADD;
@ -25,7 +25,7 @@ function performanceMarkerMiddleware(store) {
const { messages } = action;
const totalMessageCount = store.getState().messages.messagesById.size;
ChromeUtils.addProfilerMarker(
"WebconsoleAddMessages",
`WebconsoleAddMessages (${sessionId})`,
startTime,
`${messages.length} messages handled, store now has ${totalMessageCount} messages`
);

View File

@ -95,7 +95,7 @@ function configureStore(webConsoleUI, options = {}) {
const { toolbox } = options.thunkArgs;
const sessionId = (toolbox && toolbox.sessionId) || -1;
const middleware = applyMiddleware(
performanceMarker,
performanceMarker.bind(null, sessionId),
ignore,
thunkWithOptions.bind(null, {
prefsService,