Giter Site home page Giter Site logo

Comments (13)

matejzero avatar matejzero commented on September 26, 2024 1

It looks like it's working as it should:)

Unpurged/deleted reports still have a link which might come handy sometime, but purged are not linked. From my side it works as expected.

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024 1

Yea yea, typo on my end:)

Unchanged reports that are still on the disk and not purged by purge -unchanged.

from puppet-summary.

skx avatar skx commented on September 26, 2024

With that volume of reports I can see that this would be a useful enhancement.

I would probably add a new flag to the prune command:

  • puppet-summary prune -days=3
    • Delete all reports which are older than 3 days.
    • This means remove from the various views and delete the report from disk.
  • puppet-summary prune -unchanged
    • Delete all reports from disc where the status is "unchanged".
    • But keep the reports in the various views.

I'm just a little unsure whether to keep the references to the "unchanged" reports in the views; on the one hand it shows you that puppet did run, on the other hand if you can't click it for the details maybe it is not worth showing?

If we remove the entries, not just the files, then I suspect the end result is that over time nodes would become "orphaned" as the might be days where every run was "unchanged" - so if we remove them all the node will have no local state.

That makes me think we just reap the report-files, and leave the records (until they're removed via the -days mechanism). Does that seem sane?

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

I would definitely keep the references to the "unchanged" states for the exact reason you said in the other part of reply. I want to see if puppet was ran or not, because this way I can see "orphaned" hosts, which comes handy from time to time (catching users who forget to start puppet after testing:P)

As far as your commands go, they seem sane and simple to use. Would one then have to run puppet-summary prune -unchanged via crontab?

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

For test, I erased all unchanged reports and disk usage changed from 12GB to 28MB.

from puppet-summary.

skx avatar skx commented on September 26, 2024

The commit e0487ee should have given you what you want.

Update via:

    go get -u github.com/skx/puppet-summary

Then run this to test it:

   puppet-summary prune -unchanged [-prefix ./blah/blah]

The downside is, as I realized too late, that the links to the report will still exist - because the renderer doesn't read/touch the path. So you'll get a 404..

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Wow, that was fast:)

Compiled and ran it, it cleaned up my reports folder nicely. prune added to hourly crontab.

And, as you already realized, I get 404 when accessing unexisting report:

open reports/pruned: no such file or directory

One solution would be to check if report ID is pruned here and in this case, not create a link. I'm not sure if this is a good solution or not, but this one came to mind:)

from puppet-summary.

skx avatar skx commented on September 26, 2024

Yeah it needs a bit more work, as the report ID is numeric - it's the yaml_file column in the database which is set to pruned - and that isn't part of the struct/record that the node-view has access to.

Shouldn't be hard to fix, but it'll take me a day or two I guess.

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Ooo ok:) I would help you, but Go is not my thing:/

Yea, no need to hurry, current solution works for me. Not linking unchanged reports is just a nice touch:)

from puppet-summary.

skx avatar skx commented on September 26, 2024

Got there in the end :)

from puppet-summary.

matejzero avatar matejzero commented on September 26, 2024

Great! Will recompile today.

This patch is really helping me to keep low disk usage. I'm keeping 14 days of reports and disk usage is around 27GB for cca 16k reports/day.

from puppet-summary.

skx avatar skx commented on September 26, 2024

Nice to hear it works at that kind of scale!

Let me know if you do/don't see any problem, and then I'll tag a new release.

from puppet-summary.

skx avatar skx commented on September 26, 2024

I assume you meant "Unpurged/undeleted", i.e. reports of changes are still linked.

But thanks for the speedy update. I'll tag a new release later in the day, which will show up on the download-page.

from puppet-summary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.