gri 10.0.6 → 10.0.7

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: 3e8b36dc97ced45aa0de1a72697dcd52ff48e555
4
- data.tar.gz: d0b0fbdab14c4dcd5fc35b6c079d1ddd371a8bde
3
+ metadata.gz: 4f65c5971ca81e3e40bb99b6c75fc9cb0e7abd13
4
+ data.tar.gz: 13ec94a6ae74dd7b05e54466df5549083dfd7c8b
5
5
  SHA512:
6
- metadata.gz: b0cee0365f9753f8792bd614d5e591af2ef0dc49440e3392c4d652541c8de4bd5b63fd4a4a196a40c21e12027b8c9542a1dcdd0dd50b7492263cc82fd37a98f5
7
- data.tar.gz: 0a22e850b4dbe14f60a76edbadfebffadf929acc5f1ef7796cedcd4331a17ef994688dbf9d5512e6b9066d507fa6f3055bd9d5311c0972ac1d07866bb0970891
6
+ metadata.gz: 961ec77bab123aba5882cc937722d62d8b9cfa6a18245b6b1664f5a90e4a0c26a30d63df7620340e88a1aceebb904f549f115d72fa5f60dfc14a113514659289
7
+ data.tar.gz: 80fdba8a08010d7d33fcc7247b0bd820fb83e7f6d440baf545ff8234e26391a80baff675c75b7d78dfb4dd132f29c9fdb70dc17b9cd8e0d12ad18b435faa23ed
@@ -27,15 +27,20 @@ class GriOutput < BufferedOutput
27
27
 
28
28
  config_param :config_path, :string, :default=>'/usr/local/gri/gri.conf'
29
29
  config_param :gra_dir, :string, :default=>nil
30
+ config_param :log_level, :string, :default=>nil
31
+ config_param :interval, :integer, :default=>nil
30
32
 
31
33
  def start
32
34
  super
33
- #::Log.init '/tmp/fluent.log'
35
+ if @log_level
36
+ ::Log.init '/tmp/out_gri.log', :log_level=>@log_level
37
+ end
34
38
  GRI::Config.init @config_path
35
39
  root_dir = GRI::Config['root-dir'] ||= GRI::Config::ROOT_PATH
36
40
  plugin_dirs = GRI::Config.getvar('plugin-dir') || [root_dir + '/plugin']
37
41
  GRI::Plugin.load_plugins plugin_dirs
38
42
  @gra_dir ||= GRI::Config['gra-dir'] || root_dir + '/gra'
43
+ @interval ||= (GRI::Config['interval'] || 300).to_i
39
44
  end
40
45
 
41
46
  def format tag, time, record
@@ -47,7 +52,7 @@ class GriOutput < BufferedOutput
47
52
  chunk.msgpack_each {|tag, time, record|
48
53
  records.push record
49
54
  }
50
- writer = GRI::Writer.create 'rrd', :gra_dir=>@gra_dir
55
+ writer = GRI::Writer.create 'rrd', :gra_dir=>@gra_dir, :interval=>@interval
51
56
  writer.write records
52
57
  writer.finalize
53
58
  end
@@ -17,8 +17,9 @@ module GRI
17
17
  path = File.join dir, fname
18
18
  begin
19
19
  require path
20
+ Log.debug "load plugin: '#{path}'"
20
21
  rescue LoadError
21
- Log.error "LoadError: #{$!}"
22
+ Log.debug "LoadError: #{$!}"
22
23
  puts "LoadError: #{$!}" if $debug
23
24
  end
24
25
  @loaded[fname] = path
@@ -130,6 +130,7 @@ module GRI
130
130
  unless @rrd
131
131
  data_name = options[:data_name]
132
132
  @specs = DEFS.get_specs data_name
133
+ Log.debug "update host=#{options[:host]} data=#{data_name}"
133
134
  return unless @specs # unknown data_name
134
135
  return unless @specs[:ds]
135
136
  #if (index_key = (@specs[:index_key] || @specs[:named_index]) and
@@ -147,6 +148,7 @@ module GRI
147
148
  end
148
149
  data = @record_keys.map {|key| record[key]}
149
150
  s = "#{time.to_i}:#{mk_update_str data}"
151
+ Log.debug "update key=#{@key} rrd data=#{s}"
150
152
  @rrd.buffered_update s
151
153
 
152
154
  if (prop = @specs[:prop]) and (descr_k = prop[:description]) and
@@ -36,7 +36,9 @@ module GRI
36
36
  if File.exist? path
37
37
  values = LTSV.load_from_file path
38
38
  nvalues = values.inject({}) {|h, v| h[v[key]] = v; h}
39
- nvalues.merge! other
39
+ for k in other.keys
40
+ nvalues[k] ? nvalues[k].merge!(other[k]) : (nvalues[k] = other[k])
41
+ end
40
42
  else
41
43
  nvalues = other
42
44
  end
@@ -1,3 +1,3 @@
1
1
  module GRI
2
- VERSION = "10.0.6"
2
+ VERSION = "10.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gri
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.0.6
4
+ version: 10.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - maebashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack