Code Monkey home page Code Monkey logo

kronos's Introduction

Kronos

Kronos is a simple periodic task scheduler. Each task is run in a separate thread. Task is written as a C++ class in a Kronos module, example of a simple module is here. The scheduler has been tested on Ubuntu 14.04. The scheduler can be compiled and run on OSX, but some modules will not work on OSX.

Compiling

cmake . && make

The binary will be generated in src/core directory and it will be called kronos.

Running

From root of the tree run

./src/core/kronos

The scheduler will start running the default modules:

  • test.cpp: just prints "hello world" every 10s
  • memory.cpp: prints and stores VM size of the process in database every 5s
  • tcp_connect.cpp: stores time to estabish tcp connection to google.com every 5s

To undrestand where the data is stored please go through the code for the test.cpp module.

Writing a new module

Writing a new module is simple. You just need to add a new .cpp file in the modules directory and extend the ModuleInterface or the PersistModule class and provide a run() method. In Case of PersistModule you also need to specify the name of the database table where you want to persist the data. Please refer test.cpp for further details and comments.

kronos's People

Contributors

smihir avatar

Watchers

 avatar  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.