PHPackages                             jonnx/laravel-timeseries-metrics - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jonnx/laravel-timeseries-metrics

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jonnx/laravel-timeseries-metrics
================================

easily create timeseries of metrics from your db queries

1.2.0(8y ago)3110MITPHP

Since Jan 27Pushed 8y agoCompare

[ Source](https://github.com/Jonnx/laravel-timeseries-metrics)[ Packagist](https://packagist.org/packages/jonnx/laravel-timeseries-metrics)[ RSS](/packages/jonnx-laravel-timeseries-metrics/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Larvel Timeseries Metrics
=========================

[](#larvel-timeseries-metrics)

A simple package to generate a base table of timestamps daily to simplify the creating and maintaining of timeseries metrics and usage graphs over time. The base table should be maintained automatically which is the entire purpose of this package. The generated table will look as follows:

```
mysql> select * from metric_intervals;
+----+---------------------+---------------------+---------------------+
| id | timestamp           | created_at          | updated_at          |
+----+---------------------+---------------------+---------------------+
|  1 | 2018-01-29 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  2 | 2018-01-28 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  3 | 2018-01-27 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  4 | 2018-01-26 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  5 | 2018-01-25 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  6 | 2018-01-24 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  7 | 2018-01-23 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
|  8 | 2018-01-22 00:00:00 | 2018-01-29 15:44:33 | 2018-01-29 15:44:33 |
+----+---------------------+---------------------+---------------------+
8 rows in set (0.00 sec)

```

Getting Started
---------------

[](#getting-started)

#### Add the reposistory

[](#add-the-reposistory)

```
jonnx/laravel-timeseries-metrics

```

#### Add the Service Provider in `/config/app.php`

[](#add-the-service-provider-in-configappphp)

```
/*
 * Package Service Providers...
 */
Jonnx\LaravelTimeseriesMetrics\LaravelTimeseriesMetricsServiceProvider::class,
```

#### Publish Vendor Files for Laravel Timeseries Metrics

[](#publish-vendor-files-for-laravel-timeseries-metrics)

```
php artisan vendor:publish --provider Jonnx\LaravelTimeseriesMetrics\LaravelTimeseriesMetricsServiceProvider

```

#### Run Migrations

[](#run-migrations)

```
php artisan migrate

```

#### Update Backfill Config `config/metrics.php`

[](#update-backfill-config-configmetricsphp)

change the interval\_backfill config to the date you need to go back to. This depends on when you launched your project and how far back your data goes.

```
