Code Monkey home page Code Monkey logo

Comments (3)

jgehrcke avatar jgehrcke commented on June 23, 2024 1

Related: #3 (comment)

Another relevant thought: not thinning out in the "recent" category should be an option. Is it currently?

from timegaps.

bhelm avatar bhelm commented on June 23, 2024

I initially thought this is what "recent" is about. I thought wrong. After 2,2TB and a successful snapshot transfer, it chose to delete the last and only source snapshot :(

After some testing, i think "recent" should be named "hours".

+1 for keeplast implementation. I would call it "latest" and rename recent to hours.

from timegaps.

jgehrcke avatar jgehrcke commented on June 23, 2024

Thanks for the feedback Wolfgang and Bernd!

I agree that the paradigm of "keep the last N" is intuitively useful. In fact, that is what I thought initially. But things seem to be a little more complicated than that.

The following example hopefully shows that simply keeping the last N can result in data loss, too, when invoking timegaps very frequently.

An item younger than 1 hour is in the "recent" category.

Let's imagine timegaps was to keep the 5 most recent (as you wrote, the 5 last or newest items) in that category.

Let's imagine items are created at a high rate, e.g. every two minutes. Let's consider the case where timegaps is invoked at a high rate, too (many times per hour, regularly or irregularly).

In this example scenario items would be deleted before they get to be 1 hour old. Propagation of the older items would not happen; and timegaps would break one of its promises.

It is precisely this effect which made me switch to the "keep the oldest items" paradigm. I seem to have thought about that a few years ago and wrote this into the TODO file:

For recent items, we should also keep the older ones so that it is safe to
invoke timegaps at any time and at any frequency. In the extreme case this
will reject the newest backup and only keep the almost-one-hour-old one,
but this is predictable and can be reliably worked around by the user. If
we rejected the oldest recent items, however, sudden frequent invocation
of item creation and timegaps would reject older items. Instead, sudden
frequent invocation of item creation and timegaps should reject the
unnecessary amount of newer items.

Got that from here:

timegaps/TODO

Line 29 in fffaf13

- For recent items, we should also keep the older ones so that it is safe to
(thanks to past Jan-Philip for writing some things down)

Now, you brought up very valid concerns. What can we do?

What if we were to keep the oldest N and the newest M in the "recent" category (again, this is where all items are in that are younger than 1 hour)? That would ensure backpropagation of the oldest items. In an extreme case it could still rip a hole of <1 hour into the item distribution, though. In terms of thinning data out this should be desired. However, if that is a problem in any workflow the only viable solution is to add another time category with a more fine-grained resolution than 1 hour.

This is just me thinking out loud!

from timegaps.

Related Issues (8)

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.