fluent-plugin-apache_modstatus 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4e3327d7ed60435a3d45620ad98b8de76d7f28c
4
- data.tar.gz: 7f62e834fb68da23bc88c4c6561bb36fec67bc1e
3
+ metadata.gz: f50303e4980331e47acf13546c4c9c4c26216f4f
4
+ data.tar.gz: 29c2b074303983e4e1d0bb70e7c911cb3664f37a
5
5
  SHA512:
6
- metadata.gz: fd8fcb838484c58bd0fe5092e40c17af18b22966a68689ece7348f9f5c05bd5389ea9b788620d2a99208a999fe2df14ca56423cff4c741d5cb7c09e610fdb076
7
- data.tar.gz: 292dfc69030b1e3facd6107de87943ddd2b6212cf66caa4cd490b6c3b11531445c9482e9ae9c055a8dde78284d536fa4fb2cce90d0266474c16a52938e5c1b52
6
+ metadata.gz: abcd937c8767b6acd38f5392025c5525d5341cbaf4873046ee00b07ffad88ac68a59ec8db2e2474b8f4df6301bbba2294f11aa0f95d98e6fe3d1bb86a0bb0ec7
7
+ data.tar.gz: c3350fd7ff5edfc9e764e5871499991e5acfc514c116efaa24d1d376938849298ff4bdcc0b76bb088aa6374a1ab4de01bb60271c83e5cc6ace672e5aa90761a3
data/README.md CHANGED
@@ -5,12 +5,12 @@ Collect Apache stats from the mod_status Module
5
5
  ## Installation
6
6
 
7
7
  ```ruby
8
- fluent-gem install fluent-plugin-diskusage
8
+ fluent-gem install fluent-plugin-apache_modstatus
9
9
  ```
10
10
  or
11
11
 
12
12
  ```ruby
13
- /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-diskusage
13
+ /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-apache_modstatus
14
14
  ```
15
15
 
16
16
  ## Usage
@@ -55,7 +55,18 @@ Your record format might vary depending on what extensions and options are turne
55
55
  "bytespersec" => "96227.8"
56
56
  "bytesperreq" => "37743.9"
57
57
  "busyworkers" => "35"
58
- "idleworkers" => "3"
58
+ "idleworkers" => "3",
59
+ "scoreboard_count_wait" => "7",
60
+ "scoreboard_count_start" => "0",
61
+ "scoreboard_count_read" => "1",
62
+ "scoreboard_count_reply" => "8",
63
+ "scoreboard_count_keepalive" => "5",
64
+ "scoreboard_count_dns" => "0",
65
+ "scoreboard_count_closing" => "2",
66
+ "scoreboard_count_log" => "0",
67
+ "scoreboard_count_graceful" => "0",
68
+ "scoreboard_count_cleanup" => "0",
69
+ "scoreboard_count_openslot" => "233"
59
70
  ```
60
71
 
61
72
  ## Contributing
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-apache_modstatus"
7
- spec.version = '0.0.3'
7
+ spec.version = '0.0.4'
8
8
  spec.authors = ["Jason Westbrook"]
9
9
  spec.email = ["jwestbrook@gmail.com"]
10
10
 
@@ -40,6 +40,57 @@ class Fluent::ApacheModStatus < Fluent::Input
40
40
  status_values = page_content.lines.map(&:chomp)
41
41
  status_values.each do |item|
42
42
  if item.include? "Scoreboard: "
43
+ # Scoreboard Key:
44
+ # "_" Waiting for Connection, "S" Starting up, "R" Reading Request,
45
+ # "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
46
+ # "C" Closing connection, "L" Logging, "G" Gracefully finishing,
47
+ # "I" Idle cleanup of worker, "." Open slot with no current process
48
+ values = item.split(": ")
49
+ scores = values[1].split(//)
50
+
51
+ scoreboard = {
52
+ "wait" => 0,
53
+ "start" => 0,
54
+ "read" => 0,
55
+ "reply" => 0,
56
+ "keepalive" => 0,
57
+ "dns" => 0,
58
+ "closing" => 0,
59
+ "log" => 0,
60
+ "graceful" => 0,
61
+ "cleanup" => 0,
62
+ "openslot" => 0
63
+ }
64
+
65
+ scores.each do |score|
66
+ if score == "_"
67
+ scoreboard["wait"] = scoreboard["wait"] + 1
68
+ elsif score == "S"
69
+ scoreboard["start"] = scoreboard["start"] + 1
70
+ elsif score == "R"
71
+ scoreboard["read"] = scoreboard["read"] + 1
72
+ elsif score == "W"
73
+ scoreboard["reply"] = scoreboard["reply"] + 1
74
+ elsif score == "K"
75
+ scoreboard["keepalive"] = scoreboard["keepalive"] + 1
76
+ elsif score == "D"
77
+ scoreboard["dns"] = scoreboard["dns"] + 1
78
+ elsif score == "C"
79
+ scoreboard["closing"] = scoreboard["closing"] + 1
80
+ elsif score == "L"
81
+ scoreboard["log"] = scoreboard["log"] + 1
82
+ elsif score == "G"
83
+ scoreboard["graceful"] = scoreboard["graceful"] + 1
84
+ elsif score == "I"
85
+ scoreboard["cleanup"] = scoreboard["cleanup"] + 1
86
+ elsif score == "."
87
+ scoreboard["openslot"] = scoreboard["openslot"] + 1
88
+ end
89
+ end
90
+
91
+ scoreboard.each do |key,score|
92
+ record["scoreboard_count_#{key}"] = score
93
+ end
43
94
 
44
95
  elsif item.include? ": "
45
96
  values = item.split(": ")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-apache_modstatus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Westbrook
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-21 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.0.14
95
+ rubygems_version: 2.0.14.1
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Gather the status from the Apache mod_status Module