Plack::Middleware::Debug::Mongo::Database - Mongo database debug panel for Plack::Middleware::Debug
version 0.01
# inside your psgi app enable 'Debug', panels => [ [ 'Mongo::Database', connection => $options ], ];
Plack::Middleware::Debug::Mongo::Database extends Plack::Middleware::Debug by adding MongoDB database statistics debug panel such as number of collections and indexes, average size of each document, total database and index size etc. This information can be obtained by command db.stats() in the mongo shell. See MongoDB Database Statistics Reference for details.
Additionally collection's statistics displayed for each collection of the database. It includes number of documents and indexes, total index and storage size, number of allocated data file regions, average size of an object in collection etc. More information and detailed description of the result see MongoDB Collection Statistics Reference.
Sample output
Database: awl_devel Key Value avgObjSize 643.318918918919 collections 8 dataSize 476056 db awl_devel fileSize 201326592 indexSize 81760 indexes 6 nsSizeMB 16 numExtents 11 objects 740 ok 1 storageSize 585728 Collection: inventory Key Value avgObjSize 171.651090342679 count 321 flags 1 indexSizes._id_ 24528 lastExtentSize 49152 nindexes 1 ns awl_devel.inventory numExtents 2 ok 1 paddingFactor 1 size 55100 storageSize 61440 totalIndexSize 24528 ...
See Plack::Middleware::Debug
MongoDB connection options. Passed as HASH reference. Default server to connect is mongodb://localhost:27017. For additional information please consult MongoDB::MongoClient page. Default database name is admin. You should change it to get fetch statistics of the desired database and its collections.
Plack::Middleware::Debug::Mongo::Database doesn't export any functions and subroutines.
Please report any bugs or feature requests through the web interface at https://github.com/Wu-Wu/Plack-Middleware-Debug-Mongo/issues
Plack::Middleware::Debug
MongoDB::MongoClient
MongoDB Database Statistics Reference
MongoDB Collection Statistics Reference
Anton Gerasimov, <chim@cpan.org>
Copyright (C) 2013 by Anton Gerasimov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::Debug::Mongo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Debug::Mongo
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Debug::Mongo
For more information on module installation, please visit the detailed CPAN module installation guide.