Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1663

Implement retention by bytes for pt-stalk

    Details

    • Type: New Feature
    • Status: Pending Release
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.0
    • Component/s: pt-stalk
    • Labels:
      None

      Description

      Currently, there is no good way of limiting and reuse the amount of space that pt-stalk can consume. There are following tunables: 
      --disk-bytes-free 
      --disk-pct-free 
      --retention-time 
      But they only allow pt-stalk logs to not occupy all the space, and once it does it simply stops working until retention time passes for the first log.

      Ideally, as SREs responsible for the service we would like to have an ability to limit the total amount of bytes that pt-stalk can consume, and after it goes over that limit it should switch to a ring buffer of logs, removing the oldest logs.

      Is it possible to implement "retention-bytes" for explicitly limiting the space usage or at least "retention-count" to limit the number of traces that pt-stalk can handle.

      Tasks

      1. Implement --retention-size option
      2. Implement --retention-count option

      Retention Size

      Limit the amount of space consumed by pt-stalk files based on size measurement of a directory.

      Applies only to files under --dest

      Pass in a friendly measurements using integer + letter, for example k, M, G, and T. 

      Default is 500M

      --retention-size=1G # Don't collect further if we've used 1GB of space 

      Retention Count

      Limit the amount of space consumed by pt-stalk files based on measuring count of collections performed.

      Applies only to files under --dest

      Accepts an integer value only.

      --retention-count=100 # Collect up to 100 collects

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                carlos.salguero Carlos Salguero
                Reporter:
                charly.batista Charly Batista
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: