fluent-plugin-ruby-memory-usage-profiler 0.0.1 → 0.0.2

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: 92df6c82ca37fad051b5fd4117cfbe4125378a1b
4
- data.tar.gz: d4f0a4e8b33e3ca128a1dfae15524de7046ac4b9
3
+ metadata.gz: fd957ccd5cd04ed3d01a05c18f7b07f0d08069ce
4
+ data.tar.gz: 1a69549a1db62e10831db7cf77ef1580071699e9
5
5
  SHA512:
6
- metadata.gz: 989aa3d31544dcd4558e6780a7b45f125e6938feb8880424973fb198442637dc6b5565fdf110736c6e1c6b3fae14724f2ddc70085a031cb0dcf4fad0ec387ec3
7
- data.tar.gz: 771ec30bd0700f27bf4e02b7f92775069f0e44dd5f284345fbb3b3390ea74faca28a17a65c1b7a6a7d532dd73c68989cc2a26163caaa8333260d501826b551e7
6
+ metadata.gz: 18b343934c4bdaf5d4079a2e52a779972098b53d7c0fefa0d06ae68a04aa2752036eb23e91a3a008512b0820b2bd4f3476ddd388c7152dbbf81e9191d232ebb9
7
+ data.tar.gz: 48a45b8adaf7f35afb5d7a9fe6bf1746a07ab38ee9f0494248689f42dd98acbd5617de1b2b02a3608d0531c433498b4fa7d5212294a2c44fdb2d4efc247eafb1
@@ -2,5 +2,6 @@
2
2
  type ruby_memory_usage_profiler
3
3
  output_type log
4
4
  loglevel info
5
+ duration 5
5
6
  </source>
6
7
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "fluent-plugin-ruby-memory-usage-profiler"
5
- spec.version = "0.0.1"
5
+ spec.version = "0.0.2"
6
6
  spec.authors = ["TAGOMORI Satoshi"]
7
7
  spec.email = ["tagomoris@gmail.com"]
8
8
  spec.description = %q{Collect memory usage profile information and emit it (or output on fluentd log)}
@@ -44,11 +44,17 @@ module Fluent
44
44
  @running = true
45
45
  @thread = Thread.new do
46
46
  begin
47
- while @running
47
+ count = 0
48
+ while sleep(1)
49
+ break unless @running
50
+
51
+ count += 1
52
+ next if count < @duration
53
+
48
54
  MemoryUsageProfiler.kick(@name) {|result|
49
55
  @out.call(result)
50
56
  }
51
- sleep @duration
57
+ count = 0
52
58
  end
53
59
  rescue => e
54
60
  $log.error "Unexpected error in ruby_memory_usage_profiler", :error_class => e.class, :error => e
@@ -58,6 +64,7 @@ module Fluent
58
64
 
59
65
  def stop
60
66
  @running = false
67
+ @thread.join
61
68
  end
62
69
  end
63
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-ruby-memory-usage-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi