Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Report prune should also clear the timeline_events table #281

Open
mattiasgeniar opened this issue Mar 17, 2014 · 2 comments
Open

Report prune should also clear the timeline_events table #281

mattiasgeniar opened this issue Mar 17, 2014 · 2 comments
Labels
Milestone

Comments

@mattiasgeniar
Copy link

ref.: http://weblog.etherized.com/posts/189.html

The table "timeline_events" is never cleared. There does not appear to be a rake task to do this. It would make sense if the task reports:prune would also clear the stale data from that table.

In our case, this table had ~4 million rows.

mysql> select count(id) from timeline_events;
+-----------+
| count(id) |
+-----------+
|   4599693 |
+-----------+
1 row in set (30.01 sec)

Whereas if we delete the obsolete rows (we prune weekly);

mysql> delete from timeline_events where created_at <= DATE_SUB(now(), INTERVAL 1 WEEK );
Query OK, 4511928 rows affected (4 min 29.87 sec)

That leaves around ~80.000 rows left, which significantly speeds things up.

@sodabrew
Copy link
Owner

I think I would prune these as a separate task, but definitely pruning needs to happen. Thanks for this report!

@sodabrew
Copy link
Owner

First step along the way: view recent events rake task: 6aebde7

~/puppet-dashboard $ bundle exec rake timeline:view
2014-01-25 04:31 UTC Node unprisoned.tetrachordon.org was updated by
2014-01-25 04:31 UTC Node unprisoned.tetrachordon.org was created by
2014-01-25 04:31 UTC Node unconjunctive.tetrachordon.org was updated by
2014-01-25 04:31 UTC Node unconjunctive.tetrachordon.org was created by
2014-01-25 04:31 UTC Node twirligig.tetrachordon.org was updated by
2014-01-25 04:31 UTC Node twirligig.tetrachordon.org was created by
2014-01-25 04:31 UTC Node tuberiform.tetrachordon.org was updated by
2014-01-25 04:31 UTC Node tuberiform.tetrachordon.org was created by
2014-01-25 04:31 UTC Node ticktacker.tetrachordon.org was updated by
2014-01-25 04:31 UTC Node ticktacker.tetrachordon.org was created by

@ZeroPointEnergy ZeroPointEnergy added this to the Release 3.2 milestone Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants