Closed Bug 1525333 Opened 6 years ago Closed 6 years ago

Provide a way to send any ping ASAP, to support manual QA

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: mdroettboom, Assigned: mdroettboom)

References

Details

(Whiteboard: [telemetry:mobilesdk:m8])

In a discussion of adding test metrics to the sample application here, it was noted that it's much more useful to add them to the baseline ping because that goes out immediately when pressing the button in the sample application. However, logically, it makes more sense to put throwaway sample metrics on the "metrics" ping. However, the metrics ping is throttled to not go out more than once every 24 hours, which isn't very helpful for testing.

We need some sort of flag in the public API so we can send a ping asap (or I'm open to other solutions).

Whiteboard: [telemetry:mobilesdk:m?] → [telemetry:mobilesdk:m5]
Blocks: 1505395
No longer blocks: 1505395
Flags: needinfo?(tlong)
Blocks: 1505395

I think you could just remove the existing stored last ping timestamp, it's definitely hacky feeling but the following snippet should work from the glean-sample app if you added it in the buttonSendPing.setOnClickListener {...} in the glean-sample MainActivity.

applicationContext.getSharedPreferences("MetricsPingScheduler", Context.MODE_PRIVATE)
  .edit()
  .remove("last_metrics_ping_timestamp")
  .apply()
Glean.handleEvent(Glean.PingEvent.Default)

I'm working on using WorkManager to start sending the pings, maybe I can add a way to override and force sending of the metrics ping. From a functionality standpoint, that might make sense to have a way to override a schedule.

Flags: needinfo?(tlong)

(In reply to Travis Long from comment #1)

I think you could just remove the existing stored last ping timestamp, it's definitely hacky feeling but the following snippet should work from the glean-sample app if you added it in the buttonSendPing.setOnClickListener {...} in the glean-sample MainActivity.

applicationContext.getSharedPreferences("MetricsPingScheduler", Context.MODE_PRIVATE)
  .edit()
  .remove("last_metrics_ping_timestamp")
  .apply()
Glean.handleEvent(Glean.PingEvent.Default)

One other approach could be to expose sendPing to tests and call sendPing("metrics"). But we don't expose that yet :)
This feels like it might require some discussion to extend the testing API, but not in the immediate future :(

I'm working on using WorkManager to start sending the pings, maybe I can add a way to override and force sending of the metrics ping. From a functionality standpoint, that might make sense to have a way to override a schedule.

Please note that bug 1508965 is for using the WorkManager for managing ping upload, not ping assembly, which is still up to glean internals.

Summary: We need a public way to send baseline ping asap, regardless of whether it's been 24 hours → We need a public way to send "metrics" ping asap, regardless of whether it's been 24 hours

(In reply to Alessio Placitelli [:Dexter] from comment #2)

One other approach could be to expose sendPing to tests and call sendPing("metrics"). But we don't expose that yet :)
This feels like it might require some discussion to extend the testing API, but not in the immediate future :(

I think he was asking in regards to using this in the samples-glean, which shouldn't have access to a function exposed to testing as it's not really a test.

Please note that bug 1508965 is for using the WorkManager for managing ping upload, not ping assembly, which is still up to glean internals.

True, I just meant that I was in the part of the code relevant to both building and sending of pings and I wasn't trying to imply that anything like this belonged in that bug, just that I would like to give it some thought while staring at the relevant code as a potential future enhancement/testing feature to be able to override a schedule to send a ping. Sorry for the confusion.

(In reply to Travis Long from comment #3)

(In reply to Alessio Placitelli [:Dexter] from comment #2)

One other approach could be to expose sendPing to tests and call sendPing("metrics"). But we don't expose that yet :)
This feels like it might require some discussion to extend the testing API, but not in the immediate future :(

I think he was asking in regards to using this in the samples-glean, which shouldn't have access to a function exposed to testing as it's not really a test.

Yes, good point. I think we might need something like this for the testing API, maybe, in the future. We can do without for the samples-glean and simply make the data go with the metrics ping :)

Priority: -- → P3
Blocks: 1520180
No longer blocks: 1505395
Summary: We need a public way to send "metrics" ping asap, regardless of whether it's been 24 hours → Provide a way to send any ping ASAP, to support manual QA

Given bug 1522430, and ignoring the "samples-glean" app (which I still think should NOT directly allow sending pings with a button), I think we should implement a runtime adb command for that. However, this is not strictly required for this milestone, so pushing it to m7

Whiteboard: [telemetry:mobilesdk:m5] → [telemetry:mobilesdk:m7]
Whiteboard: [telemetry:mobilesdk:m7] → [telemetry:mobilesdk:m8]
Assignee: nobody → mdroettboom
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Depends on: 1532926
You need to log in before you can comment on or make changes to this bug.