Skip to content

Commands to list and trim the Ops deferred queue #228

@tonyandrewmeyer

Description

@tonyandrewmeyer

Migrating from canonical/operator#2101, where there is a request for:

  • the ability for users to see the size of event queue (for deferred events). It will allow to provide customer estimates and plan hardware usage better, as differed event execution takes CPU)
  • the ability to clean unnecessary events somehow. At the moment users have to go into sqlite on unit to clean the queue => the dangerous and risky way. Otherwise wait for hours/days wasting CPU/time.

For the former, perhaps something like jhack defer-queue list that prettily lists the deferred notices (the 4 fields in the notices table), with a total count somewhere. Potentially with the snapshot, although that makes it more expensive and noisy (if anyone wanted it, there could be a future jhack defer-queue get x that showed details for one row including the snapshot, maybe?).

For the latter, perhaps something like jhack defer-queue clear [--duplicate] that wipes the notices and snapshot tables, or if --duplicate is used, then only removes duplicates. If people wanted there could be future filtering ability like limiting it to specific events.

--duplicate is a bit odd in that modern Ops won't store duplicates, so you shouldn't really have any, but it is useful if you're using an old version of Ops and have duplicates to carefully remove.

@PietroPasotti if you're on board with adding this functionality and we can agree on what it should look like, I can contribute a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions