Closed Bug 729154 Opened 12 years ago Closed 12 years ago

Telemetry for a11y instantiation by unknown cause.

Categories

(Core :: Disability Access APIs, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: davidb, Assigned: davidb)

References

Details

Attachments

(1 file, 4 obsolete files)

      No description provided.
Attached patch patch 1 (obsolete) — Splinter Review
Assignee: nobody → bolterbugz
Attachment #599217 - Flags: review?(trev.saunders)
Attachment #599217 - Flags: review?(trev.saunders)
Attached patch patch 1.01 (obsolete) — Splinter Review
Attachment #599217 - Attachment is obsolete: true
Attachment #599220 - Flags: review?(trev.saunders)
Comment on attachment 599220 [details] [diff] [review]
patch 1.01

Askalski want to take this one?

I don't really like all these assignments to atDetected, but don't really have a better idea.

>+  if (!atdetected) {
>+    statistics::A11yConsumers(UNKNOWN);
>+  }

nit, braces
Attachment #599220 - Flags: review?(trev.saunders) → review?(askalski)
looks good. I presume that we there may be multiple A11yConsumers, right? Because otherwise we could get rid off atdetected with just if (){} else if() {} else if() {}... else { UNKNOWN } . I will run mochitests and do r+ when they're ok.
Attachment #599220 - Flags: review?(askalski) → review+
(In reply to Andrzej Skalski from comment #4)
> looks good. I presume that we there may be multiple A11yConsumers, right?
Right - we never know for certain.

D
Comment on attachment 599220 [details] [diff] [review]
patch 1.01

Alexander, thumbs up? (I removed the extra braces locally)
Attachment #599220 - Flags: review?(surkov.alexander)
(In reply to David Bolter [:davidb] from comment #6)
> Comment on attachment 599220 [details] [diff] [review]
> patch 1.01
> 
> Alexander, thumbs up? (I removed the extra braces locally)

The farther into the forest, the thicker the trees. I'd say rename sModes into sATs and get rid telemetry enum. It doesn't contradict to compatibility modes interface since modes are exposed by static methods (sMode is private static member).
Comment on attachment 599220 [details] [diff] [review]
patch 1.01

canceling review until comment #7
Attachment #599220 - Flags: review?(surkov.alexander)
(In reply to alexander :surkov from comment #7)
> (In reply to David Bolter [:davidb] from comment #6)
> > Comment on attachment 599220 [details] [diff] [review]
> > patch 1.01
> > 
> > Alexander, thumbs up? (I removed the extra braces locally)
> 
> The farther into the forest, the thicker the trees. I'd say rename sModes
> into sATs and get rid telemetry enum. It doesn't contradict to compatibility
> modes interface since modes are exposed by static methods (sMode is private
> static member).

yeah,  sounds nice
Let's rework after or as part of bug 733510.
(In reply to Trevor Saunders (:tbsaunde) from comment #9)
> (In reply to alexander :surkov from comment #7)
> > (In reply to David Bolter [:davidb] from comment #6)
> > > Comment on attachment 599220 [details] [diff] [review]
> > > patch 1.01
> > > 
> > > Alexander, thumbs up? (I removed the extra braces locally)
> > 
> > The farther into the forest, the thicker the trees. I'd say rename sModes
> > into sATs and get rid telemetry enum. It doesn't contradict to compatibility
> > modes interface since modes are exposed by static methods (sMode is private
> > static member).
> 
> yeah,  sounds nice

I'm the odd one out here but I probably don't understand the details of what is been requested. What kind of data structure do we want to keep? Put another way, what would be the new of implementation of for example:
1. IsJAWS()
2. statistics::A11yConsumers(COBRA)
?

Also note we kept telem separate as per Nathan (bug 678965).

Moving back to one bitflag would take us back to the problems in that bug AFAICT.
(In reply to David Bolter [:davidb] from comment #11)
> (In reply to Trevor Saunders (:tbsaunde) from comment #9)
> > (In reply to alexander :surkov from comment #7)
> > > (In reply to David Bolter [:davidb] from comment #6)
> > > > Comment on attachment 599220 [details] [diff] [review]
> > > > patch 1.01
> > > > 
> > > > Alexander, thumbs up? (I removed the extra braces locally)
> > > 
> > > The farther into the forest, the thicker the trees. I'd say rename sModes
> > > into sATs and get rid telemetry enum. It doesn't contradict to compatibility
> > > modes interface since modes are exposed by static methods (sMode is private
> > > static member).
> > 
> > yeah,  sounds nice
> 
> I'm the odd one out here but I probably don't understand the details of what
> is been requested. What kind of data structure do we want to keep? Put
> another way, what would be the new of implementation of for example:
> 1. IsJAWS()
> 2. statistics::A11yConsumers(COBRA)
> ?
> 
> Also note we kept telem separate as per Nathan (bug 678965).
> 
> Moving back to one bitflag would take us back to the problems in that bug
> AFAICT.

I think not if we're smart about how we do it.

so, Init() would have things like

if (GetModuleHandeW("we.dll")
  sMode |= 1 << eWE;

....

uint32_t temp = sMode;
for (int i = 0; temp; i++) {
  if (temp & 0x1)
    statistics::Consumer(i);

  temp >>= 1;
}

or a little more verbosely

if (GetModuleHandleW("we.dll") {
  statistics::Consumer(WE);
  sMode |= 1 << WE;
}
....

then IsWe() is
return !!(sMode & (1 << WE));
just note: not sMode but sATs perhaps
re comment 12, OK got ya.

re comment 13, I don't think there is a great name actually since this holds info about ATs, modes, and non ATs...
BTW you guys are sure you like the direction we're going with the sample code in comment 12 right?
(In reply to David Bolter [:davidb] from comment #14)
> re comment 12, OK got ya.
> 
> re comment 13, I don't think there is a great name actually since this holds
> info about ATs, modes, and non ATs...

It doesn't contain any info about modes. non ATs - ok then maybe sConsumers.
(In reply to David Bolter [:davidb] from comment #15)
> BTW you guys are sure you like the direction we're going with the sample
> code in comment 12 right?

I think so, you dislike it for some reason?
(In reply to Trevor Saunders (:tbsaunde) from comment #17)
> (In reply to David Bolter [:davidb] from comment #15)
> > BTW you guys are sure you like the direction we're going with the sample
> > code in comment 12 right?
> 
> I think so, you dislike it for some reason?

I've grown to like it in the last 10 minutes or so. I was worried the code was becoming less straightforward but is still simple enough actually. I'll probably whip this up Monday or so.
(In reply to David Bolter [:davidb] from comment #18)
> I've grown to like it in the last 10 minutes or so. I was worried the code
> was becoming less straightforward

the code was becoming less straightforward with your initial approach :)
(In reply to alexander :surkov from comment #19)
> (In reply to David Bolter [:davidb] from comment #18)
> > I've grown to like it in the last 10 minutes or so. I was worried the code
> > was becoming less straightforward
> 
> the code was becoming less straightforward with your initial approach :)

"Straightforward" is in the eye of the beholder I guess :)
(In reply to David Bolter [:davidb] from comment #20)
> > the code was becoming less straightforward with your initial approach :)
> 
> "Straightforward" is in the eye of the beholder I guess :)

yep, that's me ;)
Attached patch patch 2 (obsolete) — Splinter Review
I haven't carefully self-reviewed yet, but am posting now so I can get to Eitan's patch.
Attachment #599220 - Attachment is obsolete: true
Attachment #614014 - Flags: review?(trev.saunders)
Comment on attachment 614014 [details] [diff] [review]
patch 2

Note to self: I've got to tweak some things on this patch: (change the telemetry max, and special case NVDA since it is 0). Also there is another patch floating somewhere for uiaautomation... want to change that value to 11)

Trev, I'm canceling review.
Attachment #614014 - Flags: review?(trev.saunders)
Attached patch patch 2.1 (obsolete) — Splinter Review
I debugged/tested the following cases and they work as expected:
IsJaws()
UNKNOWN (accprobe)
NVDA
JAWS
NVDA + JAWS in combination

I confirmed via about:telemetry as well.
Attachment #614014 - Attachment is obsolete: true
Attachment #614790 - Flags: review?(trev.saunders)
Comment on attachment 614790 [details] [diff] [review]
patch 2.1

>+  // If we have a known consumer remove the unknown bit.
>+  if (sConsumers != (1 << Compatibility::UNKNOWN))
>+    sConsumers ^= (1 << Compatibility::UNKNOWN);

I think we usually use x &= ~y for this, however in this case what you have is actually safer against the case something is wrong and sConsumers is 0.

>+
>+  // Gather telemetry
>+  PRUint32 temp = sConsumers;
>+  for (int i = 0; temp; i++) {
>+    if (temp == 0 || temp & 0x1)
>+      statistics::A11yConsumers(i);

I'm pretty sure the first part of that test can never be true otherwise we wouldn't be in the loop, I also don't understand what its for.
Attachment #614790 - Flags: review?(trev.saunders) → review+
Comment on attachment 614790 [details] [diff] [review]
patch 2.1

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

::: accessible/src/msaa/Compatibility.h
@@ +101,5 @@
>      COBRA = 6,
>      ZOOMTEXT = 7,
>      KAZAGURU = 8,
> +    YOUDAO = 9,
> +    UNKNOWN = 10

why don't you keep these as 1 << 0 and prefer to do that through whole code?
(In reply to alexander :surkov from comment #26)
> Comment on attachment 614790 [details] [diff] [review]
> patch 2.1
> 
> Review of attachment 614790 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: accessible/src/msaa/Compatibility.h
> @@ +101,5 @@
> >      COBRA = 6,
> >      ZOOMTEXT = 7,
> >      KAZAGURU = 8,
> > +    YOUDAO = 9,
> > +    UNKNOWN = 10
> 
> why don't you keep these as 1 << 0 and prefer to do that through whole code?

probably because i suggested it when I wasn't thinking about it very much.  It'll make associating telemetry data with values a little weirder, but make the code nicer I think.
(In reply to Trevor Saunders (:tbsaunde) from comment #27)

> > why don't you keep these as 1 << 0 and prefer to do that through whole code?
> 
> probably because i suggested it when I wasn't thinking about it very much. 
> It'll make associating telemetry data with values a little weirder, but make
> the code nicer I think.

yes. David, can you do a change please?
(In reply to Trevor Saunders (:tbsaunde) from comment #25)
> Comment on attachment 614790 [details] [diff] [review]
> >+    if (temp == 0 || temp & 0x1)
> >+      statistics::A11yConsumers(i);
> 
> I'm pretty sure the first part of that test can never be true otherwise we
> wouldn't be in the loop, I also don't understand what its for.

Good catch - cruft.

(In reply to alexander :surkov from comment #28)
> (In reply to Trevor Saunders (:tbsaunde) from comment #27)
> 
> > > why don't you keep these as 1 << 0 and prefer to do that through whole code?
> > 
> > probably because i suggested it

> 
> yes. David, can you do a change please?

Heh. Yep.
Attached patch patch 3Splinter Review
Patch to land. I'll update the uiautomation telemetry patch and land them on the same push.
Attachment #614790 - Attachment is obsolete: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a74a4a363fc
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/7a74a4a363fc
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Looping back... seeing a *lot* of UNKNOWN cause...  sigh.
(In reply to David Bolter [:davidb] Away July30-Aug3 from comment #33)
> Looping back... seeing a *lot* of UNKNOWN cause...  sigh.

Should we add an additional entry here for metrofx running on touch screen devices?
Actually, on these devices the desktop browser activates accessibility as well. So it's not just metrofx.
(In reply to Jim Mathies [:jimm] from comment #34)
> (In reply to David Bolter [:davidb] Away July30-Aug3 from comment #33)
> > Looping back... seeing a *lot* of UNKNOWN cause...  sigh.
> 
> Should we add an additional entry here for metrofx running on touch screen
> devices?

we look for uiautomationcore.dll or similar already, but if that doesn't cover this case sure.
(In reply to Trevor Saunders (:tbsaunde) from comment #36)
> (In reply to Jim Mathies [:jimm] from comment #34)
> > (In reply to David Bolter [:davidb] Away July30-Aug3 from comment #33)
> > > Looping back... seeing a *lot* of UNKNOWN cause...  sigh.
> > 
> > Should we add an additional entry here for metrofx running on touch screen
> > devices?
> 
> we look for uiautomationcore.dll or similar already, but if that doesn't
> cover this case sure.

(see accessible/src/msaa/Compatibility.cpp for exactly what all we look for.)
(In reply to Jim Mathies [:jimm] from comment #35)
> Actually, on these devices the desktop browser activates accessibility as
> well. So it's not just metrofx.

Yes I would like to know what proportion of our instantiation is due to these devices.
The telemetry A11Y_CONSUMERS doesn't appear to be working, or maybe the data has to be pulled out manually?(In reply to David Bolter [:davidb] Away July30-Aug3 from comment #38)
> (In reply to Jim Mathies [:jimm] from comment #35)
> > Actually, on these devices the desktop browser activates accessibility as
> > well. So it's not just metrofx.
> 
> Yes I would like to know what proportion of our instantiation is due to
> these devices.

So, not sure if I'm reading the telemetry data correctly but it looks like the highest number of instantiations comes from uiautomation @ 97%, assuming that '10' column represents UIAUTOMATION.(In reply to Trevor Saunders (:tbsaunde) from comment #36)
> (In reply to Jim Mathies [:jimm] from comment #34)
> > (In reply to David Bolter [:davidb] Away July30-Aug3 from comment #33)
> > > Looping back... seeing a *lot* of UNKNOWN cause...  sigh.
> > 
> > Should we add an additional entry here for metrofx running on touch screen
> > devices?
> 
> we look for uiautomationcore.dll or similar already, but if that doesn't
> cover this case sure.

http://mxr.mozilla.org/mozilla-central/source/accessible/src/msaa/Compatibility.cpp#87

This test fails on win8, the library name needs 'core' on the end of it to get picked up right. I filed bug 778569.
Blah, ignore that jumble of early a11y telemetry comments.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: