Git Product home page Git Product logo

mongoqp's Introduction

mongoqp

mongoqp is a frontend for MongoDB's query profiler collections (i.e. db.system.profile), built using Silex and MongoDB PHP Library.

It currently supports:

  • Toggling query profiler levels (off, slow, all) per database
  • Grouping similar queries by BSON structure
  • Reporting aggregate query statistics (min, max, average, times)
  • Sorting, pagination and filtering via DataTables

Future plans:

  • Control over slow query thresholds
  • Improving analytics
  • Persistent data collection

Screenshots

Server view

Database view

Setup

Installation

Dependencies are managed with Composer, a PHP package manager. This project is also published as a package, which means it can be installed with:

$ composer create-project jmikola/mongoqp

Configuration

The src/ directory includes a config.php.dist file, which may be copied to config.php and customized. If config.php is not present, the default configuration will be included.

Currently, the following options are available:

  • debug: Enable verbose error reporting
  • mongodb.client.uri: MongoDB connection URI string
  • mongodb.client.uriOptions: MongoDB connection URI options
  • mongodb.client.driverOptions: MongoDB driver options
  • twig.cache_dir: Cache directory for Twig templates

Database Connection

By default, the application will connect to a standalone MongoDB server on the local host (i.e. new MongoDB\Client). The connection may be customized via the mongodb.client options, like so:

$app['mongodb.client.uri'] = 'mongodb://example.com:27017';

The above example connects to a standalone server by its hostname. Consult the MongoDB PHP library documentation for additional examples on connecting to a replica set or specifying auth credentials.

Database profiling cannot be enabled on mongos instances. If you are profiling queries in a sharded cluster, the application should be configured to connect to an individual shard.

Cache Directory

By default, the application will use mongoqp-cache/ within the system's temporary directory. This path, which must be writable, may be customized via the twig.cache_dir configuration option.

Web Server

The application can be started using:

$ php -S localhost:8080 -t web

Instructions for other web server configurations are outlined in the Silex documentation.

mongoqp's People

Contributors

jmikola avatar kamorahul avatar

Watchers

James Cloos avatar  avatar

Forkers

wojtkowiak

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.