cargomedia / bipbip

UNMAINTAINED. Gather services data and store in CopperEgg/IDERA
MIT License
4 stars 7 forks source link

gearman: extend waiting/queued metrics with priority #169

Closed kris-lab closed 8 years ago

kris-lab commented 8 years ago

Part of https://github.com/cargomedia/bipbip/issues/168

kris-lab commented 8 years ago

@njam could you please give an initial look?

njam commented 8 years ago

What information do we have in mysql? We can only see the number of "queued" jobs, not the number of "active" and "waiting" right?

For consistent naming I would then call the metrics jobs_queued_total_high, jobs_queued_normal and jobs_queued_low?

kris-lab commented 8 years ago

Gearman/mysql:

mysql> describe gearman_queue;
+---------------+--------------+------+-----+---------+-------+
| Field         | Type         | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| unique_key    | varchar(64)  | YES  | MUL | NULL    |       |
| function_name | varchar(255) | YES  |     | NULL    |       |
| priority      | int(11)      | YES  |     | NULL    |       |
| data          | longblob     | YES  |     | NULL    |       |
| when_to_run   | int(11)      | YES  |     | NULL    |       |
+---------------+--------------+------+-----+---------+-------+
5 rows in set (0.00 sec)

active and waiting is the runtime information provided by gearman-api. It is not kept persistence in the db.

kris-lab commented 8 years ago

@njam what about now? We could possibly make mysql table name configurable as well.

njam commented 8 years ago

lgtm

It's a pity that we will lose the ability to alert on "waiting" jobs (instead we'll alert on "queued" jobs jobs_queued_total_high and jobs_queued_total_normal), but I don't think there's a solution.