memory_tracker 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -3
- data/lib/memory_tracker/version.rb +1 -1
- data/memory_tracker.gemspec +0 -2
- data/spec/spec_helper.rb +0 -1
- metadata +1 -18
- data/lib/memory_tracker/stores/gcstat_logfile_parser.rb +0 -31
- data/spec/lib/stores/gcstat_logfile_parser_spec.rb +0 -50
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4688993f6f3fdeccca87b014fa93724dcc73cf33
|
4
|
+
data.tar.gz: 8240428d6b4cbe354c3ffa6144e97ab2607a2510
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aae4d62a95f6a30378aa74b7458e94932dfeb7bcd4eb4d289a6748c3232cdf4c0f9de8edf038860962abb22cc7199ed64a8cb208234fed29758b4bf79acb9e4a
|
7
|
+
data.tar.gz: 84951efe7c1d590eeb582730a43b9de2a311ee1d8ba8fad257f438b9d7f481899f2241e996d3055910f9729b9bee9b384e5ccaedbd3f16f39a187eb45a1a38d6
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memory_tracker (1.2.
|
4
|
+
memory_tracker (1.2.1)
|
5
5
|
activesupport
|
6
|
-
logfile_interval (~> 1.1.0)
|
7
6
|
sys-proctable
|
8
7
|
|
9
8
|
GEM
|
@@ -26,7 +25,6 @@ GEM
|
|
26
25
|
diff-lcs (1.2.5)
|
27
26
|
i18n (0.6.9)
|
28
27
|
json (1.8.1)
|
29
|
-
logfile_interval (1.1.0)
|
30
28
|
minitest (4.7.5)
|
31
29
|
multi_json (1.8.2)
|
32
30
|
rdoc (3.12.2)
|
data/memory_tracker.gemspec
CHANGED
@@ -38,7 +38,6 @@ Gem::Specification.new do |s|
|
|
38
38
|
"lib/memory_tracker/memory_tracker.rb",
|
39
39
|
"lib/memory_tracker/middleware.rb",
|
40
40
|
"lib/memory_tracker/request.rb",
|
41
|
-
"lib/memory_tracker/stores/gcstat_logfile_parser.rb",
|
42
41
|
"lib/memory_tracker/stores/gcstat_logfile_store.rb",
|
43
42
|
"lib/memory_tracker/stores/in_memory_store.rb",
|
44
43
|
"lib/memory_tracker/stores/url_logfile_store.rb",
|
@@ -52,7 +51,6 @@ Gem::Specification.new do |s|
|
|
52
51
|
s.rubygems_version = "2.0.3"
|
53
52
|
|
54
53
|
s.add_runtime_dependency(%q<sys-proctable>, [">= 0"])
|
55
|
-
s.add_runtime_dependency(%q<logfile_interval>, ["~>1.1.0"])
|
56
54
|
s.add_runtime_dependency(%q<activesupport>)
|
57
55
|
s.add_development_dependency(%q<debugger>, [">= 0"])
|
58
56
|
s.add_development_dependency(%q<rspec>, ["~> 2.14.0"])
|
data/spec/spec_helper.rb
CHANGED
@@ -14,7 +14,6 @@ require 'memory_tracker/stores/base'
|
|
14
14
|
require 'memory_tracker/stores/loader'
|
15
15
|
require 'memory_tracker/stores/in_memory_store'
|
16
16
|
require 'memory_tracker/stores/gcstat_logfile_store'
|
17
|
-
require 'memory_tracker/stores/gcstat_logfile_parser'
|
18
17
|
require 'memory_tracker/stores/url_logfile_store'
|
19
18
|
|
20
19
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memory_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philippe Le Rohellec
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: logfile_interval
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 1.1.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: activesupport
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,7 +122,6 @@ files:
|
|
136
122
|
- lib/memory_tracker/memory_tracker.rb
|
137
123
|
- lib/memory_tracker/middleware.rb
|
138
124
|
- lib/memory_tracker/request.rb
|
139
|
-
- lib/memory_tracker/stores/gcstat_logfile_parser.rb
|
140
125
|
- lib/memory_tracker/stores/gcstat_logfile_store.rb
|
141
126
|
- lib/memory_tracker/stores/in_memory_store.rb
|
142
127
|
- lib/memory_tracker/stores/url_logfile_store.rb
|
@@ -148,7 +133,6 @@ files:
|
|
148
133
|
- spec/lib/stores/in_memory_store_spec.rb
|
149
134
|
- spec/lib/stores/loader_spec.rb
|
150
135
|
- spec/lib/stores/url_logfile_store_spec.rb
|
151
|
-
- spec/lib/stores/gcstat_logfile_parser_spec.rb
|
152
136
|
- spec/lib/request_spec.rb
|
153
137
|
- spec/lib/memory_tracker_spec.rb
|
154
138
|
homepage: http://github.com/plerohellec/memory_tracker
|
@@ -181,6 +165,5 @@ test_files:
|
|
181
165
|
- spec/lib/stores/in_memory_store_spec.rb
|
182
166
|
- spec/lib/stores/loader_spec.rb
|
183
167
|
- spec/lib/stores/url_logfile_store_spec.rb
|
184
|
-
- spec/lib/stores/gcstat_logfile_parser_spec.rb
|
185
168
|
- spec/lib/request_spec.rb
|
186
169
|
- spec/lib/memory_tracker_spec.rb
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'logfile_interval'
|
2
|
-
|
3
|
-
module MemoryTracker
|
4
|
-
module Stores
|
5
|
-
class GcstatLogfileParser < LogfileInterval::LineParser::Base
|
6
|
-
# Line format:
|
7
|
-
# timestamp,action,count,heap_final_num,heap_free_num,heap_increment,heap_length,heap_live_num,heap_used,rss,total_allocated_object,total_freed_object,vsize
|
8
|
-
|
9
|
-
|
10
|
-
set_regex /^(\d+),(\w+#\w+),(\d+),(\d+),(\d+),(\d+),(\d+),(\d+),(\d+),([\d\.]+),(\d+),(\d+),([\d\.]+)$/
|
11
|
-
|
12
|
-
add_column :name => :timestamp, :pos => 1, :aggregator => :timestamp
|
13
|
-
add_column :name => :action, :pos => 2, :aggregator => :count, :group_by => :action
|
14
|
-
add_column :name => :count, :pos => 3, :aggregator => :average, :conversion => :integer
|
15
|
-
# add_column :name => :heap_final_num, :pos => 4, :aggregator => :average, :conversion => :integer
|
16
|
-
# add_column :name => :heap_free_num, :pos => 5, :aggregator => :average, :conversion => :integer
|
17
|
-
# add_column :name => :heap_increment, :pos => 6, :aggregator => :average, :conversion => :integer
|
18
|
-
# add_column :name => :heap_length, :pos => 7, :aggregator => :average, :conversion => :integer
|
19
|
-
# add_column :name => :heap_live_num, :pos => 8, :aggregator => :average, :conversion => :integer
|
20
|
-
add_column :name => :heap_used, :pos => 9, :aggregator => :average, :conversion => :integer
|
21
|
-
add_column :name => :rss, :pos => 10, :aggregator => :delta, :conversion => :float, :group_by => :action
|
22
|
-
add_column :name => :total_allocated_object, :pos => 11, :aggregator => :average, :conversion => :integer
|
23
|
-
# add_column :name => :total_freed_object, :pos => 12, :aggregator => :average, :conversion => :integer
|
24
|
-
add_column :name => :vsize, :pos => 13, :aggregator => :delta, :conversion => :float, :group_by => :action
|
25
|
-
|
26
|
-
def time
|
27
|
-
Time.at(self.timestamp.to_i)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
GCSTAT_LOGFILE_DATA = <<LINES
|
4
|
-
1386125780,posts#index,49,0,63777,571,1431,349791,860,88.055808,1686477,1336686,269.484032
|
5
|
-
1386125782,posts#show,50,0,108615,517,1431,325083,914,90.218496,1770275,1445192,271.48287999999997
|
6
|
-
1386125784,posts#show,51,0,108361,513,1431,272900,918,90.759168,1826445,1553545,272.15871999999996
|
7
|
-
1386125785,posts#index,52,0,103229,513,1431,287439,918,90.759168,1917742,1630303,272.15871999999996
|
8
|
-
1386125787,posts#index,52,0,103386,513,1431,372228,918,91.29983999999999,2002688,1630460,272.78950399999997
|
9
|
-
1386125789,posts#index,54,0,101731,495,1431,289801,936,92.577792,2109945,1820144,273.77664
|
10
|
-
1386125792,posts#show,54,0,101731,495,1431,375282,936,92.577792,2195426,1820144,273.77664
|
11
|
-
1386125794,posts#show,55,0,123765,441,1431,324209,990,94.949376,2267943,1943734,276.271104
|
12
|
-
LINES
|
13
|
-
|
14
|
-
module MemoryTracker
|
15
|
-
module Stores
|
16
|
-
describe GcstatLogfileParser do
|
17
|
-
before :each do
|
18
|
-
@lines = GCSTAT_LOGFILE_DATA.split("\n")
|
19
|
-
@parser = GcstatLogfileParser
|
20
|
-
|
21
|
-
expectation = LogfileInterval::Logfile.any_instance.should_receive(:each_line)
|
22
|
-
@lines.reverse.each { |line| expectation.and_yield(line) }
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'iterates over each line' do
|
26
|
-
logfile_iterator = LogfileInterval::Logfile.new('foo', @parser)
|
27
|
-
result_lines = []
|
28
|
-
logfile_iterator.each_line do |line|
|
29
|
-
result_lines << line
|
30
|
-
end
|
31
|
-
|
32
|
-
result_lines.count.should == 8
|
33
|
-
result_lines.first.should == @lines.last
|
34
|
-
result_lines.last.should == @lines.first
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'iterates over each parsed line' do
|
38
|
-
logfile_iterator = LogfileInterval::Logfile.new('foo', @parser)
|
39
|
-
records = []
|
40
|
-
logfile_iterator.each_parsed_line do |record|
|
41
|
-
records << record
|
42
|
-
end
|
43
|
-
|
44
|
-
records.count.should == 8
|
45
|
-
records.first.count.should == @lines.last.split(',')[2].to_i
|
46
|
-
records.last.count.should == @lines.first.split(',')[2].to_i
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|