暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
mtools官方手册20211221.pdf
434
32页
0次
2021-12-21
5墨值下载
mtools
pypi
pypi
v1.6.4
v1.6.4
build
build
passing
passing
Python
Python
3.6
3.6
Python
Python
3.7
3.7
Python
Python
3.8
3.8
mtools is a collection of helper scripts to parse, filter, and visualize MongoDB log files ( mongod ,
mongos ). mtools also includes mlaunch , a utility to quickly set up complex MongoDB test
environments on a local machine.
What’s in the box?
The following tools are in the mtools collection:
mlogfilter
slices log files by time, merges log files, filters slow queries, finds table scans, shortens log
lines, filters by other attributes, convert to JSON
mloginfo
returns info about log file, like start and end time, version, binary, special sections like
restarts, connections, distinct view
mplotqueries
visualize log files with different types of plots (requires matplotlib )
mlogvis
creates a self-contained HTML file that shows an interactive visualization in a web browser
(as an alternative to mplotqueries )
mlaunch
a script to spin up local test environments quickly, including replica sets and sharded
systems (requires pymongo )
mtransfer
an experimental script to transfer WiredTiger databases between MongoDB instances by
copying data files (requires pymongo and wiredtiger )
The mtools source code is available on GitHub under an Apache 2.0 license.
1mlogfilter
A script to reduce the amount of information from MongoDB log files. mlogfilter takes one or
several MongoDB log files as input, together with some filter parameters, parses the contained
log lines and outputs the lines that match according to the filter parameters.
If several log files are provided, mlogfilter will merge them by timestamp and insert a marker at
the beginning of each line, before applying any of the other filters.
Usage
mlogfilter can also be used with shell pipe syntax:
General Parameters
Help
-h, --help
shows the help text and exits.
Version
--version
shows the version number and exits.
Verbosity
--verbose
shows extra information about the parser and arguments. This is usually only needed for
debugging purposes.
Shorten Log Lines
--shorten [LENGTH]
will shorten long lines to at most LENGTH characters, only showing the beginning and end of
a line. If LENGTH is not provided, the default is 200. This is useful to ensure that each log line
fits into a shell / editor window to compare certain re-occurring values. The line is split in the
middle and the excess characters are replaced with ... .
Human Readability
--human
makes log lines easier to read for humans. Long numbers will be separated by “thousands”
comma separators, and the duration at the end of an operation is augmented with the
hours, minutes and seconds for readability.
mlogfilter [-h] [--version] logfile [logfile ...]
     [--verbose] [--shorten [LENGTH]]
     [--human] [--exclude] [--json]
     [--timestamp-format {ctime-pre2.4, ctime, iso8601-utc, iso8601-
local}]
     [--markers MARKERS [MARKERS ...]] [--timezone N [N ...]]
     [--namespace NS] [--operation OP] [--thread THREAD]
     [--slow [SLOW]] [--fast [FAST]] [--scan]
     [--word WORD [WORD ...]]
     [--from FROM [FROM ...]] [--to TO [TO ...]]
cat logfile | mlogfilter [parameters]
of 32
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜