Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kucherenko/caiman
Times series data library. Store data to files or to mongoDB.
https://github.com/kucherenko/caiman
caiman database db series-data statistics timeseries
Last synced: 24 days ago
JSON representation
Times series data library. Store data to files or to mongoDB.
- Host: GitHub
- URL: https://github.com/kucherenko/caiman
- Owner: kucherenko
- Created: 2016-11-08T21:49:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T06:35:40.000Z (about 1 year ago)
- Last Synced: 2024-04-09T14:46:53.361Z (7 months ago)
- Topics: caiman, database, db, series-data, statistics, timeseries
- Language: JavaScript
- Homepage:
- Size: 881 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Caiman - statistic alligator
![Caiman - times series library](https://rawgit.com/kucherenko/caiman/master/caiman.svg)
## Times series data library.Library helps organize time series data. Caiman can be used for IoT systems,
stock data, different type of statistics, etc. As database caiman can use file-based database.### Installation
```
npm install caiman --save
```or
```
yarn add caiman --save
```### Usage
```javascript
import {Caiman} from caiman;const options = {
driver: {
type: 'files',
options:{
path: '/tmp/'
}
}
}, periods = ['month', 'day', 'hour', 'minute', 'second'];
let currentDate = new Date();let temperatureSensor = new Caiman('temperature_sensor', options);
//save average value binded to current date and time, will collect average values
// posible values of last parameter are 'averages', 'aggregate', 'summarize' or you can use your own strategy
temperatureSensor.save(currentDate, periods, Math.random() * 100, 'averages');//get collection of values by year, will return coolection of average values by monthes
console.log(stat.getCollection(currentDate, 'year'));//get collection of values by month, will return coolection of average values by days
console.log(stat.getCollection(currentDate, 'month'));//get collection of values by day, will return coolection of average values by hours
console.log(stat.getCollection(currentDate, 'day'));//get collection of values by hour, will return coolection of average values by minutes
console.log(stat.getCollection(currentDate, 'hour'));//get collection of values by hour, will return coolection of average values by seconds
console.log(stat.getCollection(currentDate, 'minute'));```
### Run tests
```
yarn test
```
### TODO
- Redis support
- Add CI
- Add badges
### LicenceMIT