fluent-plugin-anomalydetect 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f17aef618203dff62c12e92c20cfe75bb15ac25
4
- data.tar.gz: c8ec9bd378b6a860849d62da0e47ca0be76d8496
3
+ metadata.gz: 85a6c9f30ea4c80eba3c4bb42f02f28ad32d1ce7
4
+ data.tar.gz: af58f39de4592757c801d16fbf2fe3847d959cd5
5
5
  SHA512:
6
- metadata.gz: 3897bb15f6337a90ccbbad40b31790dcb2276956d6be4764d917f04e3bbee522de4675a612875cf21296d510cfe4fd9ed4bf664c57e72caebc398733c3f567d5
7
- data.tar.gz: 7f0c0e735d3f00169514fe7aef92645d101d11b045372b75f9520f144353b4780b68c9804cd1758cad9e537bb79b5eb5e205b3feffe985dbf14c60b8648c66d5
6
+ metadata.gz: bd32d62aef8924d6df33e4cb09f89e87e531820bc1450a370c1184c07f0aa3ab7a2cda6c9fa1faf56b39d6bca99ee6aa263d935a3d65854acf85e07e05b104b5
7
+ data.tar.gz: 49b6bc57171e1223be3a3ce5a2f8370c4ebffc4cec794ca61b0890916664323c1291a4915a989b89d6e1ac09747bd78acd7293245d14e90cf8138e6fde607c71
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.9.2
3
+ - 1.9.3
4
+ - 2.0.0
5
+ gemfile:
6
+ - Gemfile
7
+ - Gemfile.fluentd.lt.0.10.43
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'fluentd', '= 0.10.42'
4
+ gemspec
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
-
2
+ require "octorelease"
3
3
  require 'rake/testtask'
4
4
  Rake::TestTask.new(:test) do |test|
5
5
  test.libs << 'lib' << 'test'
@@ -3,7 +3,7 @@ lib = File.expand_path('../lib', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = "fluent-plugin-anomalydetect"
6
- gem.version = "0.1.4"
6
+ gem.version = "0.1.5"
7
7
  gem.authors = ["Muddy Dixon"]
8
8
  gem.email = ["muddydixon@gmail.com"]
9
9
  gem.description = %q{detect anomal sequential input casually}
@@ -1,6 +1,11 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module Fluent
3
3
  class ChangeFinder
4
+ # To support log_level option implemented by Fluentd v0.10.43
5
+ unless method_defined?(:log)
6
+ define_method("log") { $log }
7
+ end
8
+
4
9
  require 'matrix'
5
10
  attr_reader :mu
6
11
 
@@ -23,10 +28,10 @@ module Fluent
23
28
  c = @sigma
24
29
  for j in 0..(@term - 1)
25
30
  if @data[len - 1 - j]
26
- @c[j] = (1 - @r) * @c[j] + @r * (x - @mu) * (@data[len - 1 - j] - @mu)
31
+ @c[j] = (1 - @r) * @c[j] + @r * (x - @mu) * (@data[len - 1 - j] - @mu)
27
32
  end
28
33
  end
29
-
34
+
30
35
  cc = Matrix.zero(@term).to_a
31
36
  for j in 0..(@term - 1)
32
37
  for i in j..(@term - 1)
@@ -46,7 +51,7 @@ module Fluent
46
51
 
47
52
  p = prob(xt, @sigma, x)
48
53
  s = score(p)
49
- $log.debug "change_finder:#{Thread.current.object_id} x:#{x} xt:#{xt} p:#{p} s:#{s} term:#{@term} r:#{@r} data:#{@data} mu:#{@mu} sigma:#{@sigma} c:#{@c}"
54
+ log.debug "change_finder:#{Thread.current.object_id} x:#{x} xt:#{xt} p:#{p} s:#{s} term:#{@term} r:#{@r} data:#{@data} mu:#{@mu} sigma:#{@sigma} c:#{@c}"
50
55
  s
51
56
  end
52
57
 
@@ -1,5 +1,11 @@
1
1
  module Fluent
2
2
  class AnomalyDetectOutput < Output
3
+
4
+ # To support log_level option implemented by Fluentd v0.10.43
5
+ unless method_defined?(:log)
6
+ define_method("log") { $log }
7
+ end
8
+
3
9
  Fluent::Plugin.register_output('anomalydetect', self)
4
10
 
5
11
  require_relative 'change_finder'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-anomalydetect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muddy Dixon
@@ -74,7 +74,9 @@ extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
76
  - .gitignore
77
+ - .travis.yml
77
78
  - Gemfile
79
+ - Gemfile.fluentd.lt.0.10.43
78
80
  - README.md
79
81
  - Rakefile
80
82
  - fluent-plugin-anormalydetect.gemspec