Closed
Bug 1161698
Opened 10 years ago
Closed 9 years ago
Imported profiles should use their filename as the display label
Categories
(DevTools :: Performance Tools (Profiler/Timeline), defect)
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Firefox 44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: jsantell, Assigned: henrik, Mentored)
References
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 5 obsolete files)
4.99 KB,
patch
|
jsantell
:
review+
|
Details | Diff | Splinter Review |
Or, when saving, save the RecordingModel's label as the filename (s/\.json//) before exporting. I think I like the latter option better, too.
Updated•10 years ago
|
Blocks: perf-tool-papercuts
Reporter | ||
Updated•9 years ago
|
Mentor: jsantell
Whiteboard: [good first bug][lang=js]
Comment 1•9 years ago
|
||
I implemented the behaviour you descripted in your comment. Should I write tests ? If yes, where are they located ?
Attachment #8646215 -
Flags: review?(jsantell)
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8646215 [details] [diff] [review]
bug-1161698-save-label-as-filename.patch
Review of attachment 8646215 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks! I think instead of saving the label in the file, I think going with changing it upon importing is the better way to go -- this lets the user change the file name, and when importing, uses the latest filename, rather than whatever it was originally exported as.
So, same idea, just in loadRecordingFromFile, check if there is a label property, and if not, use the current file name (stripping the extension). Testing should be pretty straight forward, I think checking in `browser_perf_recordings-io-01.js` that the label is "tmpprofile" should do the trick, rather than comparing the label properties of the imported file (because they will no longer be equal, and is just checking undefined, I think anyway). Please send another review with those changes, and I think this'll be great :)
::: browser/devtools/performance/modules/logic/io.js
@@ +54,5 @@
> let deferred = promise.defer();
>
> recordingData.fileType = PERF_TOOL_SERIALIZER_IDENTIFIER;
> recordingData.version = PERF_TOOL_SERIALIZER_CURRENT_VERSION;
> + recordingData.label = file.leafName.replace(/\..+$/, ''); // set the label to the filename without its extension
nit: Move the comment so it's above this line, rather than at the end of it
Attachment #8646215 -
Flags: review?(jsantell)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → schtroumps31
Comment 3•9 years ago
|
||
Attachment #8646215 -
Attachment is obsolete: true
Attachment #8647560 -
Flags: review?(jsantell)
Comment 6•9 years ago
|
||
This was actually the good patch :/ . I'm sorry I messed up the patches, now it's causing a lot of trouble.
Flags: needinfo?(jsantell)
Reporter | ||
Comment 7•9 years ago
|
||
So there was some large changes over the last few days -- I think this'll need to be rebased, the io.js file having moved to toolkit/devtools/performance/io.js -- Wilhem, can you check this out to see if everything is still good on this patch?
Flags: needinfo?(jsantell)
Reporter | ||
Comment 8•9 years ago
|
||
Comment on attachment 8647560 [details] [diff] [review]
bug1161698_set_label_to_filename_when_importing.patch
Review of attachment 8647560 [details] [diff] [review]:
-----------------------------------------------------------------
Removing this review for now -- let me know if there are any questions you have or how I can help!
Attachment #8647560 -
Flags: review?(jsantell)
Comment 9•9 years ago
|
||
Here is the revised patch :)
Attachment #8647560 -
Attachment is obsolete: true
Flags: needinfo?(jsantell)
Attachment #8651654 -
Flags: review?(jsantell)
Reporter | ||
Comment 10•9 years ago
|
||
Comment on attachment 8651654 [details] [diff] [review]
bug1161698_set_label_to_filename_when_importing.patch
Review of attachment 8651654 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great! Just some minor formatting changes
::: toolkit/devtools/performance/io.js
@@ +104,4 @@
> if (recordingData.profile.meta.version === 2) {
> RecordingUtils.deflateProfile(recordingData.profile);
> }
> + if(!recordingData.label)
nit: space after `if` and opening this curly bracket on this line, so:
`if (!recordingData.label) {`
@@ +106,5 @@
> }
> + if(!recordingData.label)
> + {
> + // set it to the filename without its extension
> + recordingData.label = file.leafName.replace(/\..+$/, '');
Use double quotes
recordingData.label = file.leafName.replace(/\..+$/, "");
Attachment #8651654 -
Flags: review?(jsantell)
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(jsantell)
Reporter | ||
Comment 11•9 years ago
|
||
Ping Wilhem -- any updates on this? I can help with a small test for this as well if needed. Thanks!
Flags: needinfo?(nounoursheureux)
No updates in many months, unassigning.
Assignee: nounoursheureux → nobody
Flags: needinfo?(nounoursheureux)
Assignee | ||
Comment 13•9 years ago
|
||
Packaged Wilhelm's code along with the suggested fixes into the new file locations.
The label to the left in performance profiler now contains the filename when importing, rather than just an incremented number.
Assignee | ||
Updated•9 years ago
|
Attachment #8671298 -
Flags: review?(jsantell)
Reporter | ||
Comment 14•9 years ago
|
||
Comment on attachment 8671298 [details] [diff] [review]
bug_1161698_set_label_to_filename_when_importing.patch
Review of attachment 8671298 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, Henrik -- thanks! Pushing to try to see how it does: https://treeherder.mozilla.org/#/jobs?repo=try&revision=6498cd8ad3b8
Attachment #8671298 -
Flags: review?(jsantell) → review+
Reporter | ||
Comment 15•9 years ago
|
||
ni? myself so i can check back on the tests later
Flags: needinfo?(jsantell)
Reporter | ||
Comment 16•9 years ago
|
||
Looks like there's a small error in the test[0] -- the tmpprofile created appends additional characters to ensure uniqueness -- the test finds them as `tmpprofile-3` -- we can just check to see if the label starts with `tmpprofile` in this case.
[0] https://treeherder.mozilla.org/#/jobs?repo=try&revision=6498cd8ad3b8
Flags: needinfo?(jsantell) → needinfo?(henrik)
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → henrik
Reporter | ||
Comment 17•9 years ago
|
||
Retrying with the change in comment#16 https://treeherder.mozilla.org/#/jobs?repo=try&revision=39db259ab00e
Assignee | ||
Comment 18•9 years ago
|
||
Errors from Comment#17 refers to "devtools/client/performance/test/browser_perf-recordings-io-04.js", line 146. It would seem we also need to "ignore" the '-3' portion of the output. I am not sure if this is sufficient or the nicest solution, but here goes:
Based on comment #16 and error output from test run in comment #17.
Additionally, could someone please hint how to locally run these tests, there's such an abundance of different kinds accessible. Tried ./mach mochitest "filename" but that tests something else.
Attachment #8671298 -
Attachment is obsolete: true
Flags: needinfo?(henrik)
Attachment #8673113 -
Flags: review?(jsantell)
Reporter | ||
Comment 19•9 years ago
|
||
Attachment #8651654 -
Attachment is obsolete: true
Attachment #8673113 -
Attachment is obsolete: true
Attachment #8673113 -
Flags: review?(jsantell)
Attachment #8673209 -
Flags: review+
Reporter | ||
Comment 20•9 years ago
|
||
For running tests, `./mach mochitest path/to/test` will work, and testing the whole tool can be run via `./mach mochitest devtools/client/performance` in this case. These are browser mochitests and more info is here: https://developer.mozilla.org/en-US/docs/Browser_chrome_tests
Reporter | ||
Comment 22•9 years ago
|
||
Just landed this -- thanks for your contributions, Henrik!
Comment 23•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•