fluent-plugin-mongo-slow-query 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fluent/plugin/in_mongo_slow_query.rb +7 -3
- metadata +5 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzU3MTIyMzEzNTlkMDY5Nzg4OWE4NGUxYzNjYTI5ZGQxZjY0NDFiOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjhmZWFlMmE3YTA5MjY3NGY5M2QxMzgwYWZiZGY4NTg4MDViYjE3YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDJkOTE2ODVmNGUyNGFjMzg5N2YxYjQ2NmMxYjJiNjg0OGYxOTk4ZGQ0YTg1
|
10
|
+
YmNiMTZmYzE1MzIzMDJkYjg0MTQwZTJiOGM1ZDExOTA0MWVkOWVkOTJjMmU5
|
11
|
+
MjJlNTI5ZDlhYzcwYjliMTdiNjZmZWIyNTkwMGYzMDQwMzYzYjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTNkZjVhOWU2NGJjMDNlM2UzZGU0OGY2OGIyNzdhMTE4YmQyZmI2MzViMWZm
|
14
|
+
MjYzNGJiODg2NzI1NmYxZWE2ZjVjNDVmNTNkOWM2NDYyZGNhMDg0MDY2Mzdm
|
15
|
+
NTI0ZDJlODlkNjFjZGIzNmU4MmU2MjQyYmQ3MzkxMjNiY2IzNDI=
|
@@ -11,7 +11,7 @@ module Fluent
|
|
11
11
|
# If the configuration is invalid, raise Fluent::ConfigError.
|
12
12
|
def configure(conf)
|
13
13
|
# load log format for MongoDB
|
14
|
-
conf["format"] = '/^(?<time>.*?)(?:\s+\w\s\w+\s*)? \[conn\d+\] (?<op>\w+) (?<ns>\S+) (?<detail>
|
14
|
+
conf["format"] = '/^(?<time>.*?)(?:\s+\w\s\w+\s*)? \[conn\d+\] (?<op>\w+) (?<ns>\S+) (?<detail>query: (?<query>\{(?:\g<query>|[^\{\}])*\})(?: update: (?<update>\{(?:\g<update>|[^\{\}])*\}))?|command:.*?(?<command>\{(?:\g<command>|[^\{\}])*\})|.*?) (?<stat>.*?)(?: locks:\{.*\})? (?<ms>\d+)ms$/'
|
15
15
|
|
16
16
|
# not set "time_format"
|
17
17
|
# default use Ruby's DateTime.parse() to pase time
|
@@ -37,7 +37,11 @@ module Fluent
|
|
37
37
|
line.chomp! # remove \n
|
38
38
|
time, record = parse_line(line)
|
39
39
|
if time && record
|
40
|
-
record
|
40
|
+
if record.has_key?("query")
|
41
|
+
record["query"] = get_query_prototype(record["query"])
|
42
|
+
else
|
43
|
+
record["query"] = ""
|
44
|
+
end
|
41
45
|
record["ms"] = record["ms"].to_i
|
42
46
|
record["ts"] = time
|
43
47
|
|
@@ -115,7 +119,7 @@ module Fluent
|
|
115
119
|
ns_array += extract_query_prototype(val, ns)
|
116
120
|
elsif val.class == Array
|
117
121
|
val.each do |item|
|
118
|
-
if item.class == Hash # e.g. $eq $gt $gte $lt $lte $ne $in $nin
|
122
|
+
if item.class == Hash # e.g. $eq $gt $gte $lt $lte $ne $in $nin
|
119
123
|
ns_array += extract_query_prototype(item, ns)
|
120
124
|
else # e.g. $and $or $nor
|
121
125
|
ns_array << ns
|
metadata
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-mongo-slow-query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Siyang Cao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Fluent plugin for MongoDB slow operation
|
14
|
-
the slow queries and build indexes
|
13
|
+
description: Fluent input plugin for MongoDB to collect slow operation log
|
15
14
|
email: csy3228@gmail.com
|
16
15
|
executables: []
|
17
16
|
extensions: []
|
@@ -41,6 +40,5 @@ rubyforge_project:
|
|
41
40
|
rubygems_version: 2.4.5
|
42
41
|
signing_key:
|
43
42
|
specification_version: 4
|
44
|
-
summary: Fluent plugin for MongoDB slow operation
|
45
|
-
slow queries and build indexes
|
43
|
+
summary: Fluent input plugin for MongoDB to collect slow operation log
|
46
44
|
test_files: []
|