Page MenuHomePhabricator

Options for implementing JobQueue statistics methods
Open, NormalPublic

Description

There's a bunch of statistics-related methods in the JobQueue class that allow to find out the current size of the queue, number of executed, deduplicated or abandoned jobs. These methods are used in some API calls and maintenance scripts and some wiki administrators actually use that statistics. Although it's not critically important, it would be nice to implement that functionality in the JobQueueEventBus as well.

The complication though is that we don't know the queue size in mediawiki - only Kafka kinda know the size of the queue. So there're several options:

  • Use redis to update some counters on pushing and popping. This sounds like a terrible solution from all perspectives.
  • Make EventBus service expose some endpoint with queue status. It will get the information by getting the metadata from the Kafka client and shuffling it to an appropriate format. The downside of this solution is that EventBus service needs to know which consumer groups ChangeProp uses. It's possible to make it know that, but it's a fairly ugly solution.
  • Make ChangeProp expose the same endpoint. The downside is that right now MediaWiki doesn't directly talk to changeprop and adding this dependency is not really desirable.
  • Drop the statistics functionality all together
  • Graph queue size in graphite or prometheus, and retrieve current value from the graphite / prometheus API.
  • Other?

How do you think we should proceed?

Event Timeline

Pchelolo created this task.Sep 14 2017, 8:10 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 14 2017, 8:10 PM
GWicke updated the task description. (Show Details)Sep 18 2017, 2:53 PM

Added the "fetch metrics from graphite / prometheus" option.

fdans moved this task from Incoming to Radar on the Analytics board.Sep 21 2017, 4:20 PM