Giter VIP home page Giter VIP logo

omni's Introduction

Omni

What is Omni?

Omni (in this case) is short for Omniscient - which is the capacity to know everything there is to know. Quite fitting for a Profiler for Laravel eh?

Omni allows you to see:

  • Total execution time
  • Total memory usage
  • SQL Query Log
  • All variables passed to views

Installation

To add Omni to your Laravel application, add the following to your composer.json file:

"sorora/omni" : "dev-master"

Then run composer update or composer install if you have not already installed packages. One final step is needed, add the below to the providers array in app/config/app.php configuration file:

'Sorora\Omni\Providers\OmniServiceProvider',

Configuration

You will want to run the following command to publish the config to your application, otherwise it will be overwritten in updates.

php artisan config:publish sorora/omni

Profiler

Set this option to false to disable the profiler. It is true by default.

// Config.php
'profiler' => true

If you wish to disable the profiler during your application, just do:

Config::set('omni::profiler', false);

Note:: This will only disable the output, it will still do it's background listening but will not output it to the browser.

jQuery

Set this option to false to not pull in jQuery from within the Omni profiler. This is useful if you already have jQuery present on your page requests. Set to true by default.

// Config.php
'jquery' => true

Usage

Custom Timers

To start a timer, all you need to do is:

Omni::start('my timer key');

To end the timer, simply call the end function like so:

Omni::end('my timer key');

Logging

Omni utilizes Laravels built in logging system and captures logged events. To log events, you can do (as you would with laravel) any of these:

Log::debug('Your message here');
Log::info('Your message here');
Log::notice('Your message here');
Log::warning('Your message here');
Log::error('Your message here');
Log::critical('Your message here');
Log::alert('Your message here');
Log::emergency('Your message here');

These are colour coded in the Logs part of the Omni profiler - colours may change in future to more accurately reflect the log type.

omni's People

Watchers

James Cloos 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.