Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Garbage collecting tasks #285

Closed
lpalm opened this issue Mar 4, 2016 · 7 comments
Closed

Garbage collecting tasks #285

lpalm opened this issue Mar 4, 2016 · 7 comments
Milestone

Comments

@lpalm
Copy link

lpalm commented Mar 4, 2016

I have test tasks that users iterate on by backtesting them until they reach a desired configuration and threshold. Once that happens, the task is upgraded to a production task which can be managed manually.
Not all backtested tasks will graduate to production, and some may be abandoned for a while and be worked on again. These build up so we'd like to be able to periodically and automatically clean up any tasks that haven't been run in the last X weeks. Currently I don't see a way to get the last modified time or last active time of a task. Is this available somewhere? These tasks backtest tasks would only ever be used to record and replay past data.
I could potentially add a "created" timestamp to the name of the task, but this feels a bit kludgy and might cause problems for tasks that are being actively worked on.

@nathanielc
Copy link
Contributor

Those stats are not available but can be added: Would adding a created and last enabled date be enough, to implement the clean up code on your end?

@lpalm
Copy link
Author

lpalm commented Mar 4, 2016

It would. Assuming we can get a last recorded/replayed date for backtest tasks and last enabled date for production tasks we probably don't actually need/care for a created date. A last modified date instead would be more useful (a creation would count as a modification in this case). The goal here is to clean up tasks that haven't been used or modified recently.

Thanks!

@nathanielc nathanielc added this to the v0.13 milestone Apr 5, 2016
@nathanielc
Copy link
Contributor

@lpalm I am starting work on this. Just to make sure what I have planned will work....

I plan to add to dates to all tasks.

  1. Last enabled date
  2. Last modified date

What this means is that to find unused tasks you would search for tasks that are:

  1. Not enabled
  2. Last enabled date is more the X old
  3. Last modified date is more the Y old

Depending on your needs. Note the a task make have really old enabled and modified dates but still be active because it is currently enabled and simply hasn't needed to change in a while.

Also work is nearly done to add a golang HTTP client for the API so that should help with the automation aspect.

@lpalm
Copy link
Author

lpalm commented Apr 5, 2016

@nathanielc that sounds good. If the created date is easy to keep, it would be handy for auditing/stats collection down the road. That's not a blocker and not as important as the enabled/modified dates, though.

@yosiat
Copy link
Contributor

yosiat commented Apr 5, 2016

I think it will be a good addition to add LastCollectedTime and LastEmittedTime for nodes, so you can find tasks that aren't in use or don't trigger alerts.

@lpalm
Copy link
Author

lpalm commented Apr 5, 2016

@yosiat we currently log both the batched/aggregated datapoints used as inputs to the alerts and the alert firing instances themselves into InfluxDB. This has some overlap with your use case (tracking emissions) and I believe will be natively supported soon (#286. we currently do it with a simple HTTP/JSON translator).

@yosiat
Copy link
Contributor

yosiat commented Apr 5, 2016

@lpalm I am talking about a streaming mode where we ingest directly to Kapacitor and where we don't want to save historical statistics to influxdb.
A simple dates for last collected and last emitted can be very helpful, for example: querying "/tasks" and find tasks with stream1 that didn't emitted for the last X days.

nathanielc pushed a commit that referenced this issue May 5, 2016
fixes #285, track dates for easy deletion of unused tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants