您的位置:首页 > 数据库 > Mongodb

M202: MongoDB Advanced Deployment and Operations - Chapter 5: Log Files

2016-09-06 15:46 309 查看

5.1: Finding configuration errors in log files

bindIp


5.2: Examining a Log File with Mtools

# mloginfo --queries mtools_example.log
source: mtools_example.log
host: unknown
start: 2014 Jun 21 00:11:00.041
end: 2014 Jun 21 00:12:59.999
date format: iso8601-utc
length: 174406
binary: unknown
version: = 2.6.x (iso8601 format)
storage: unknown

QUERIES

namespace                            operation        pattern                                                                        count    min (ms)    max (ms)    mean (ms)    95%-ile (ms)    sum (ms)

grilled.indigo.papaya                update           {"_id": 1, "l": {"$not": 1}}                                                    4227           0        3872          482          1189.4    2038017
grilled.indigo.grapefruit            update           {"_id": 1}                                                                      1170           0        2516          479         1196.85    560682
grilled.indigo.salal.berry           update           {"clusterId": 1}                                                                 843           0        2805          502          1385.0    423825
grilled.indigo.papaya                update           {"_id": 1}                                                                      4760           0        2557           82          583.15    393992
grilled.indigo.papaya                remove           {"_id": 1}                                                                       716           0        2544          462          1066.5    331478
grilled.indigo.tangerine             update           {"_id": 1}                                                                       380           0        3037          484          1144.2    184188
...


{"_id": 1, "l": {"$not": 1}}


5.3: Plotting a Log File with Mtools

# mlogfilter --namespace grilled.indigo.papaya --pattern '{"_id": 1, "l": {"$not": 1}}' mtools_example.log > a.log

# mplotqueries --type histogram  a.log  --bucketsize 1

HISTOGRAM plot
id   #points  group
1      4227  grilled.indigo.papaya

keyboard shortcuts (focus must be on figure window):

p  switch to pan mode
o  switch to zoom mode
left/right  back / forward
h  home (original view)
l  toggle log/linear y-axis
f  toggle fullscreen
1-9  toggle visibility of top 10 individual plots 1-9
0  toggle visibility of all plots
-  toggle visibility of legend
g  toggle grid
c  toggle 'created with' footnote
s  save figure
q  quit mplotqueries

87 grilled.indigo.papaya events in 1 sec beginning at Jun 21 00:12:36


(OK) 60-90 ops/s

120-180 ops/s

300-450 ops/s

600-900 ops/s

1200-1080 ops/s

-eof-
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mongodb