Giter Club home page Giter Club logo

mongobench's Introduction

MongoBench

Benchmarking tool for the MongoDB Ruby driver. The goal is to contain functionality to test and time different types of queries in a configurable environment. The main executable, mongobench, can be run with many different flags and invoking a number of tests.

Installation

You need an accessible installation of MongoDB. It does not have to be running locally as you can specify the hostname and port of the MongoDB instance from the command line.

You will need the mongo gem installed. For optimal performance, make sure to install the mongo_ext gem as well:

sudo gem install mongo mongo_ext

No other gem requirements are needed at this time.

Running

For basic usage, see this:

mongobench --help

That will give you a rundown of what options and tests are available to you. An example run would be like this:

mongobench --threads 20 --max_sleep 0 --time 30 --run simple

That will run the simple test (a find_one) for 30 seconds, spinning up 20 threads to perform the test, not sleeping at all between requests to the database.

A neat thing to try is to open another window and run mongosniff to see the traffic as you run the benchmarks. Something like this:

sudo mongosniff --source NET lo0

Or whatever interface the traffic will be flowing over.

Adding tests

Adding your own tests is as easy as adding a new method to the MongoQueries class. It takes the format of:

def testname_test(id)

The “id” parameter is the worker thread ID (used for logging). For example, here is the simple test, which just performs a find_one:

def simple_test(id)
  document = @collection.find_one()
end

mongobench's People

Contributors

bratta avatar

Watchers

Brian Shirai avatar Wilson Bilkovich avatar Christopher Rigor avatar Wayne Seguin avatar Paul Campbell avatar Erik Jones avatar Eduardo Tongson avatar Ken Rimple avatar Neil Galvin avatar ara.t.howard avatar Andrea O. K. Wright avatar Jim Neath avatar Jen-Mei Wu avatar  avatar Jacob Burkhart avatar Kevin Rutten avatar John Trupiano avatar Kirk Haines avatar Thomas E Enebo avatar Chirag Singhal avatar Dennis J. Bell avatar The Working Group Inc avatar Lance Vaughn avatar Jason Hansen avatar Keith Gaddis avatar Michael Taus avatar Amy Woodward avatar Shawn Hermann avatar David Coallier avatar Helgi Þormar Þorbjörnsson avatar Mike Heffner avatar Eamon Leonard avatar Dennis Walters avatar David Keener avatar Ralph Bankston avatar Radamanthus Batnag avatar Evan Machnic avatar ugurarpaci avatar K Shae Murphy avatar Jamie Bleichner avatar Ramon Marques avatar Gabe Monroy avatar PJ avatar Mostafa Kenawey avatar Zlatko Unger avatar  avatar colleen avatar Robert avatar  avatar Josh avatar Ronan Flynn-Curran avatar  avatar Eugene Howe avatar Jane avatar Chris Tosswill avatar Britt Mileshosky avatar Denis Diachkov avatar James Cloos avatar Mauro Calvi avatar Eben Goodman avatar  avatar Mark Lynn avatar Matt Jones avatar Paul Tingle avatar  avatar Ryan Gurney avatar  avatar  avatar Mike Davis avatar  avatar Mal Knox avatar  avatar Elaine Greenberg avatar Jack Francis avatar Keri Meredith avatar Edward Chiu avatar Zhen Yin avatar Tim Romero avatar Carlos avatar Takahiro Imanaka avatar Daniel Valfre avatar Diego Ragazzi avatar  avatar Stephanie avatar Kevin Phelps avatar  avatar Joshua Anderson avatar Jennifer Chow avatar  avatar  avatar Callum Pease avatar  avatar  avatar  avatar  avatar Josh Pederson avatar Artsiom Kuts avatar Karishma Haji avatar Jeff Reich 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.