dns_one 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns_one/server.rb +5 -4
- data/lib/dns_one/stat.rb +1 -11
- data/lib/dns_one/util.rb +10 -0
- data/lib/dns_one/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e177edc18b9dee7569ef4f36ffe951cc8e37ec
|
4
|
+
data.tar.gz: 2d30c670b7da2f45f598c4b61fe9793b45bf793b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20cb2fa761289854fc132714969986ec8be21e4e4bef50e7cfada2c90690b14a2c2fc049b15ce7efe9fc8f24353ad31fd75ec242dce24eb8bcc62f0d64690250
|
7
|
+
data.tar.gz: 6bac3289e65ac4b4bdc9973d650b0220280bc705f76a1a8844f0574887c9a7a9ed7f5bf4e1a8c96733573ad51cf06746b1936b1fc0e64b59f94f79c676095d2e
|
data/lib/dns_one/server.rb
CHANGED
@@ -89,14 +89,15 @@ module DnsOne; class Server
|
|
89
89
|
log_result[:cache] ||= 0
|
90
90
|
log_result[:cache] += 1 if from_cache
|
91
91
|
|
92
|
+
rcode_uc = Util.const_underscore rcode
|
92
93
|
log_result[:rcode] ||= {}
|
93
|
-
log_result[:rcode][
|
94
|
-
log_result[:rcode][
|
94
|
+
log_result[:rcode][rcode_uc] ||= 0
|
95
|
+
log_result[:rcode][rcode_uc] += 1
|
95
96
|
|
96
|
-
req_resource = Util.last_mod
|
97
|
+
req_resource = Util.last_mod(t.resource_class).downcase
|
97
98
|
log_result[:req_resource] ||= {}
|
98
99
|
log_result[:req_resource][req_resource] ||= 0
|
99
|
-
log_result[:req_resource][req_resource] += 1
|
100
|
+
log_result[:req_resource][req_resource] += 1
|
100
101
|
}
|
101
102
|
end
|
102
103
|
|
data/lib/dns_one/stat.rb
CHANGED
@@ -75,7 +75,7 @@ module DnsOne; class Stat
|
|
75
75
|
Resolv::DNS::RCode.constants.map{|c|
|
76
76
|
[
|
77
77
|
Resolv::DNS::RCode.const_get(c),
|
78
|
-
const_underscore(c)
|
78
|
+
Util.const_underscore(c)
|
79
79
|
]
|
80
80
|
}
|
81
81
|
]
|
@@ -149,16 +149,6 @@ module DnsOne; class Stat
|
|
149
149
|
DB_FNAME
|
150
150
|
end
|
151
151
|
|
152
|
-
def const_underscore name
|
153
|
-
name = name.to_s.dup
|
154
|
-
name.gsub!('::', '/')
|
155
|
-
name.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
156
|
-
name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
157
|
-
name.tr!("-", "_")
|
158
|
-
name.downcase!
|
159
|
-
name
|
160
|
-
end
|
161
|
-
|
162
152
|
def rsql *sql
|
163
153
|
t0 = Time.now if META_STAT_ON
|
164
154
|
res = @db.execute *sql
|
data/lib/dns_one/util.rb
CHANGED
@@ -53,4 +53,14 @@ module DnsOne; class Util
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
def const_underscore name
|
57
|
+
name = name.to_s.dup
|
58
|
+
name.gsub!('::', '/')
|
59
|
+
name.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
60
|
+
name.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
61
|
+
name.tr!("-", "_")
|
62
|
+
name.downcase!
|
63
|
+
name
|
64
|
+
end
|
65
|
+
|
56
66
|
end; end
|
data/lib/dns_one/version.rb
CHANGED