Tell the exact number of bytes if below 1Kb

RESOLVED FIXED in Firefox 49

Status

defect
RESOLVED FIXED
3 years ago
10 months ago

People

(Reporter: bruant.d, Assigned: gregtatum)

Tracking

46 Branch
Firefox 49

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

3 years ago
The network monitor always provides the size of HTTP requests in Kb, but sometimes, the body is a few chars  (for instance 2 chars for an empty JSON array "[]"). The network monitor then reports "0,00Kb". It's a correct approximation, but a useless information; much less useful than the actual number of byte to figure out whether the body actually has 0 chars or just a few of them.

If the body is less than 1Kb, maybe the actual byte count would be more useful.
(Assignee)

Updated

3 years ago
Assignee: nobody → gtatum
(Assignee)

Comment 2

3 years ago
This adds the functionality to both the size and transfer column.
(Assignee)

Comment 3

3 years ago
Posted image Screenshot of panel
(Assignee)

Updated

3 years ago
Attachment #8745037 - Flags: review?(odvarko)
Comment on attachment 8745037 [details] [diff] [review]
Tell the exact number of bytes in network monitor if below 1Kb

Review of attachment 8745037 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me!

At some point we could also support MB and perhaps have a helper function
like e.g. this one [1], but it's outside of scope of this bug.

I am r- because there are test failures in the try push, for example: 
INFO TEST-UNEXPECTED-FAIL | devtools/client/netmonitor/test/browser_net_content-type.js | The displayed size is correct. - Got 42 B, expected 0.04 KB

Theses need to be fixed.

Honza


[1] https://github.com/firebug/firebug/blob/master/extension/content/firebug/lib/string.js#L683
Attachment #8745037 - Flags: review?(odvarko) → review-
(Assignee)

Comment 5

3 years ago
Ok, I'll get this fixed. The memory tool also has a similar function. I wonder if we should put it in a shared folder.

https://dxr.mozilla.org/mozilla-central/source/devtools/client/memory/utils.js#513-529
(In reply to Greg Tatum [:gregtatum] [@gregtatum] from comment #5)
> The memory tool also has a similar function. I
> wonder if we should put it in a shared folder.
Yes, I support the idea (and it's ok for me if it's done as part of this bug).

Honza
(Assignee)

Comment 8

3 years ago
Ok, I changed up this patch a little bit. I was looking into creating a
generalized formatting function, but the memory tool does things a bit
differently, so I didn't go that route. I went ahead and added support for some
of the higher sizes. Now we have B, KB, MB, and GB. I also made the call to
switch between them once numbers got to three digits. For instance instead of
showing 1010.00 KB, I have it showing 0.98 MB instead, so that the formatting
is a bit nicer in the columns.

Also in that try run I have a broken eslint whitespace rule which I have fixed in
this patch.
Attachment #8749651 - Flags: review?(odvarko)
(Assignee)

Updated

3 years ago
Attachment #8745037 - Attachment is obsolete: true
Comment on attachment 8749651 [details] [diff] [review]
Tell the exact number of bytes in network monitor if below 1Kb

Review of attachment 8749651 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, looks good to me!

One possible follow up could be improvement of the tooltip. It could show precise number of bytes (kbytes?) for those users who are interested in exact size.
It currently shows the same number as displayed in the column and so, not that useful.

Honza
Attachment #8749651 - Flags: review?(odvarko) → review+
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 11

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/39fd1cdc461c
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
I have reproduced this bug with Nightly 48.0a1 (2016-04-12) on Windows 7 , 64 Bit !

This bug's fix is verified with latest Beta !

Build   ID  20160912134115
User Agent  Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0

[bugday-20160914]

Updated

10 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.