Coder Social home page Coder Social logo

laravel-system-monitor's Introduction

laravel-system-monitor

Author Build Status Quality Score Software License Packagist Version Total Downloads

This package will be monitor application metrices. It is dynamic configurable, but with the default settings you will be able to show some basic stuff.

This package usage statsd as a default output but off course you can implement your own store

Install

This package depends on the statsd client from the php league. Read their manual to get it up and running

Install the package:

composer require jildertmiedema/laravel-system-monitor

Add these lines in the config/app.php file in the providers array.

JildertMiedema\SystemMonitor\SystemMonitorServiceProvider::class,
League\StatsD\Laravel5\Provider\StatsdServiceProvider::class,

If you've added the artisan schedule:run command to your cron, then you can add this to your App\Console\Kernel class

protected function schedule(Schedule $schedule)
{
    $schedule->command('measurement:run')->everyMinute();
}

Now the system will send the measurement results to Statsd every minute

Configuration

To publish the config use:

php artisan vendor:publish --tag="config"

Change the config/measurement.php file to your needs.

Measurements can be configured by choosing a type and key. The type is the type of the type of the measurement. The key is the statsd key. Per type some additional settings are required.

  • mysql.speed The reaction time of a mysql connection. (Configure a connection)
  • redis.speed The reaction time of a redis connection. (Configure a connection)
  • queue.size Measures to amount of items in the queue. (Configure a queue)
  • queue.waiting-time Put a job on the queue and measures how long it takes before its handled by the queue. (Configure a queue)

Testing

Run this command to show the result as console output. php artisan measurement:run --debug

Statsd server

This package is design to be send to a statsd server. Of course you can implement your own MeasurementStore to send it elsewhere. Some docker stuff is created to receive (and show) data. Show me

Extending

This package comes with a default setup, but you can easly extend or replace parts.

To create your own measurement, create a new class that implements the JildertMiedema\SystemMonitor\Measurements\Measurement interface. To register your class insert this in a service provider:

use JildertMiedema\SystemMonitor\Measurements\Manager;

$this->app->resolving('measurement', function (Manager $manager) {
    $manager->extend($this->app[YourMeasurementClass::class]);
});

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.