Giter Site home page Giter Site logo

rrdb's Introduction

Round Robin Database

Note

I have started writing with the command name (and general abbreviation) RRDB, and that is what I will call it! Because... idk.

Prompt

Requirements for a Round Robin Database tool (RRD)

  • An RRD is a circular structure (list) with a fixed number of slots to store data.
  • It is filled in order, and once you reach the end of the list, the first element gets overwritten. This ensures the size of the database does not grow over time while keeping the most recent data available.
  • The RRD will store a timestamp (epoch) and a value (float).
  • The goal is to build a command line executable to (1) save and (2) query the data.
  • Save command:
    • The value will be saved in two round robin structures in a simple database (e.g. SQLite)
    • The first RRD will keep the values for the last hour (i.e. each slot will represent a minute within the last 60 minutes)
    • The second keeps values per hour, for the last 24 hours. To determine the value per hour to save, please choose the minimum from the list of values per minute: i.e. valueOnHour1 = min(valueOnMinute0, valueOnMinute1, valueOnMinute2, ..., valueOnMinute59)
    • Assume NULL for slots with no information.
    • rrd save {epoch_timestamp} {float_to_save}
    • E.g. rrd save 1674476760 33.1
  • Query command: retrieves the data from the RRD
    • Display the data stored in the minutes or hours RRD files, and output the average, maximum and minimum values.
    • rrd query minutes. Example output:
1345018980, 132.1
1345019040, 322.1
1345019160, NULL
...
1345022580, 53.3
minutes: min: 53.3, avg: 403.3, max: 512.11
    • rrd query hours. Example output:
1345021200, 132.1
1345024800, 122.1
...
1345028400, 453.3
hours: min: 53.3, avg: 403.3, max: 512.11

rrdb's People

Contributors

enemigopython avatar

Watchers

 avatar

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.