Closed Bug 1549982 Opened 5 years ago Closed 5 years ago

Add documentation for why GleanDebugActivity pings sent with `sendPings` are missing `duration`

Categories

(Data Platform and Tools :: Glean: SDK, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: travis_, Assigned: travis_)

References

Details

(Whiteboard: [telemetry:mobilesdk:m?])

Attachments

(1 file)

The duration is missing from the pings that are normally sent when going into the background when they are forcibly sent by the GleanDebugActivity. This is due to the duration being completed in the GleanLifecycleObserver before the pings are being sent, which doesn't happen when using GleanDebugActivity to send the pings.

We should just need to close the duration in the GleanDebugActivity before it calls the sendPingsByName function.

This isn't going to be as straightforward to fix as I first thought. Since the change to Timespans that made them pass in an object to key start and stop with, I figured I could just pass in the instance of GleanLifecycleObserver from Glean.kt into the stopAndSum function inside of GleanDebugActivity order to stop and sum the duration. Unfortunately, this doesn't seem to work and just shows up as an error count in the ping rather than the duration.

Assignee: tlong → nobody
Whiteboard: [telemetry:mobilesdk:m?]

I looked a bit into this, and I don't think this, per se, is a bug. I think that we have 2 ways to test things:

  1. use the debug view to tag pings, then manually trigger pings using the app UI;
  2. use the debug view to tag and send pings.

The (1) should always produce a ping with all the required fields. However, with (2), we should not really expect app behaviour dependent pings to be there. The duration is collected/stored when the app goes through its normal lifecycle of background/foreground, which is some specific behaviour we should not encode with the debug view.

I think we should really make the documentation very explicit about this, to avoid confusion.

That makes sense to me, I've renamed this bug to reflect adding documentation around expected behavior so we can use it to track that work.

Summary: GleanDebugActivity pings sent with `sendPings` are missing `duration` → Add documentation for why GleanDebugActivity pings sent with `sendPings` are missing `duration`

Travis, any chance you could take this if you have some spare cycles?

Flags: needinfo?(tlong)
Assignee: nobody → tlong
Flags: needinfo?(tlong)
Attached file GitHub Pull Request

The related PR was merged, closing this!

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Type: defect → enhancement
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: