Way too many significant figures in telemetry dashboard

RESOLVED FIXED in Unreviewed

Status

Mozilla Metrics
Frontend Reports
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Justin Lebar (not reading bugmail), Assigned: Paulo Pires)

Tracking

({regression})

unspecified
Unreviewed
x86_64
Linux
regression

Details

(Whiteboard: [Telemetry])

(Reporter)

Description

6 years ago
Telemetry dashboard is showing me something like 12 significant figures when I mouseover a bar.

I don't recall this being the case in the past!
(Assignee)

Comment 1

6 years ago
Fixed, when the bar is greater than 1% it shows 2 significant figures, lower than that shows 6 significant figures, I think that's enough but let me know what you think
Assignee: nobody → paulo.pires
(Assignee)

Updated

6 years ago
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Reporter)

Comment 2

6 years ago
> lower than that shows 6 significant figures

It shows 6 digits; that's not the same thing.

http://en.wikipedia.org/wiki/Significant_figure

I think displaying to two or three sigfigs everywhere would be appropriate.  Displaying 0.192491 is not really any better than displaying 1.92491, and we agree that the latter should be rounded to 1.92. 
Note that 0.000023 has two significant figures.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 3

6 years ago
Fixed
(Reporter)

Comment 4

6 years ago
Almost there!

Now in the CYCLE_COLLECTOR histogram, some of the tiny bars to the right have three significant figures (e.g. 0.225), but some only have two sigfigs (e.g. 0.45).  Maybe 0.45 should be 0.450?
(Assignee)

Comment 5

6 years ago
As it says on the wikipedia link that you posted:

"This includes all digits except:

    leading and trailing zeros which are merely placeholders to indicate the scale of the number."

so 0.450 has a trailing zero and the function removes it.
I guess this bug can be closed.
(Reporter)

Comment 6

6 years ago
> "This includes all digits except:
>    leading and trailing zeros which are merely placeholders to indicate the scale of the number."

The final 0 in "0.450" is not a placeholder indicating the scale of the number, because "0.45" is mathematically the same as "0.450".

On the other hand, "Trailing zeros in a number containing a decimal point are significant."  So 0.45 has two sig-figs, but 0.450 has three.
(In reply to Justin Lebar [:jlebar] from comment #6)
> > "This includes all digits except:
> >    leading and trailing zeros which are merely placeholders to indicate the scale of the number."
> 
> The final 0 in "0.450" is not a placeholder indicating the scale of the
> number, because "0.45" is mathematically the same as "0.450".
> 
> On the other hand, "Trailing zeros in a number containing a decimal point
> are significant."  So 0.45 has two sig-figs, but 0.450 has three.

Justin,

Paulo needs to implement sigfigs correctly, but I don't see in this bug where it was decided whether we were going to do two or three sigfigs.  Comment two suggests either would be fine and the examples there mix usage of both two and three sigfigs.

Which does the Telemetry team want as a general implementation?  I'll make sure that is properly implemented on the dashboards.
(Reporter)

Comment 8

6 years ago
I don't care whether we use two or three sigfigs, as long as it's consistent.

(In case it's not clear, this issue is really low on my list of priorities.  The main problem was fixed long ago.)
Okay.  I'll just declare that we want to use three sigfig and a number format of 0.# so that means that we could see either 0.450 or 1.45.

Since it is low priority, let's leave it open since I'm not sure if the JS libraries we are working with have a decent sigfig formatting function already, and I'd rather take the dev time on higher priority stuff than perfecting this implementation at the moment.
(Assignee)

Comment 10

6 years ago
Should be fixed now, take a look.
Whiteboard: [Telemetry]
(Assignee)

Updated

6 years ago
Status: REOPENED → RESOLVED
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.