Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/caosiyang/fluent-plugin-mongo-slow-query

fluent plugin for mongoDB slow query
https://github.com/caosiyang/fluent-plugin-mongo-slow-query

Last synced: about 2 months ago
JSON representation

fluent plugin for mongoDB slow query

Awesome Lists containing this project

README

        

# fluent-plugin-mongo-slow-query

It will be helpful to find out the slow operations of MongoDB and ayalyze the query prototype.
The usage is almost same as **in_tail**.

## Install

```$ fluent-gem install fluent-plugin-mongo-slow-query```

## Configuration

```

type mongo_slow_query
path /path/to/mongodb/logfile

```

## Description

- **time** local time of host that the MongoDB instance is running on
- **op** operation, for example: query update remove getmore command
- **ns** namespace, concatenation of the database name and the collection name
- **detail** the deatils of operation
- **query** the prototype of query, it is an empty string when *op* is command
for example:
{ address: { country: "China", city: "Beijing" } } => { address.country, address.city }
{ ts: { $gt: 1411029300, $lt: 1411029302 } => { ts.$gt, ts.$lt }
it's convenient to statistics the similar slow queries with the same prototype and build indexes
- **ms** time used, unit: millisecond
- **nscanned** number of documents scanned
- **nmatched** number of documents matched
- **nmodified** number of documents modified
- **reslen** response length

## Support

- MongoDB v2.4
- MongoDB v2.6
- MongoDB v3.0