Skip to main content

A Labtasker plugin that groups tasks according to recency.

Project description

labtasker-plugin-task-recency

A Labtasker plugin for retrieving tasks grouped by time chunks.

Overview

This plugin extends Labtasker's functionality by allowing you to retrieve tasks that occurred within specific time chunks. It groups tasks based on time intervals between consecutive tasks, making it easy to analyze and process tasks that were submitted in bursts.

Installation

pip install labtasker-plugin-task-recency

Usage

labtasker task recent [OPTIONS]

Options

Option Default Description
--by created_at The timestamp field to group tasks by. Options: created_at, start_time, last_heartbeat, last_modified
--interval, -i 5s Time interval to define chunks. Accepts duration strings like 1h, 1h30m, 50s
--k, -k 1 Which chunk to retrieve (1 is most recent, 2 is second most recent, etc.)
--order desc Sort order within each chunk. Options: desc (newest first), asc (oldest first)

Examples

  1. Get the most recent batch of tasks (tasks submitted with less than 5 seconds between them):

    labtasker task recent
    
  2. Get the second most recent batch of tasks:

    labtasker task recent --k 2
    
  3. Get tasks grouped by a 1-hour interval:

    labtasker task recent --interval 1h
    
  4. Get tasks grouped by their start time instead of creation time:

    labtasker task recent --by start_time
    
  5. Get the oldest batch of tasks:

    labtasker task recent --k 1 --order asc
    

How It Works

The plugin groups tasks into "chunks" based on the time gaps between consecutive tasks. If two tasks are submitted with a gap smaller than the specified interval, they belong to the same chunk. When the time gap exceeds the interval, a new chunk begins.

This approach is useful for identifying batches of tasks that were submitted together, allowing for easier management and analysis of task patterns.

Use Cases

  • Batch delete / update of most recently submitted tasks
    labtasker task recent | labtasker task delete -y
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

labtasker_plugin_task_recency-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

labtasker_plugin_task_recency-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file labtasker_plugin_task_recency-0.1.0.tar.gz.

File metadata

File hashes

Hashes for labtasker_plugin_task_recency-0.1.0.tar.gz
Algorithm Hash digest
SHA256 481cb8318dd43787ee8291a8e495c30231afba98317c45c0ca3c46b323632c3e
MD5 75ee533a980eb3970b335b1f25196630
BLAKE2b-256 b60403dc2d4fbe2c3ea5612c0c266a4b6e5fb62c91991251128d0e5883cf6e80

See more details on using hashes here.

Provenance

The following attestation bundles were made for labtasker_plugin_task_recency-0.1.0.tar.gz:

Publisher: release.yml on luocfprime/labtasker-plugin-task-recency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file labtasker_plugin_task_recency-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for labtasker_plugin_task_recency-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 284000044c6e2276ac92bfecf060f51ec447054a871e76b8f8d7e6143b81a43a
MD5 ea39f0d4f9d738c11e30b91b2264c6a8
BLAKE2b-256 c058fc21a31230bf5086125b176d68249306756375f4fb482fc98f8c52d99e3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for labtasker_plugin_task_recency-0.1.0-py3-none-any.whl:

Publisher: release.yml on luocfprime/labtasker-plugin-task-recency

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page