innodb_ruby 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
data/bin/innodb_space CHANGED
@@ -613,13 +613,13 @@ def print_inode_detail(inode)
613
613
  end
614
614
 
615
615
  def space_inodes_summary(space)
616
- space.each_inode do |inode|
616
+ space.each_allocated_inode do |inode|
617
617
  print_inode_summary(inode)
618
618
  end
619
619
  end
620
620
 
621
621
  def space_inodes_detail(space)
622
- space.each_inode do |inode|
622
+ space.each_allocated_inode do |inode|
623
623
  print_inode_detail(inode)
624
624
  end
625
625
  end
@@ -666,7 +666,7 @@ def page_account(innodb_system, space, page_number)
666
666
  end
667
667
 
668
668
  page_inode = nil
669
- space.each_inode do |inode|
669
+ space.each_allocated_inode do |inode|
670
670
  inode.each_list do |name, list|
671
671
  if list.include? xdes
672
672
  page_inode = inode
@@ -755,7 +755,7 @@ def page_directory_summary(page_number)
755
755
  end
756
756
 
757
757
  def page_illustrate(page)
758
- width = 256
758
+ width = 64
759
759
  blocks = Array.new(page.size, " ")
760
760
  identifiers = {}
761
761
  identifier_sort = 0
@@ -1062,6 +1062,10 @@ The following modes are supported:
1062
1062
  color and Unicode box drawing characters to show page usage throughout
1063
1063
  the space.
1064
1064
 
1065
+ space-lsn-age-illustrate
1066
+ Iterate through all pages, producing a heat map colored by the page LSN
1067
+ allowing the user to get an overview of page modification recency.
1068
+
1065
1069
  space-inodes-summary
1066
1070
  Iterate through all inodes, printing a short summary of each FSEG.
1067
1071
 
@@ -1113,6 +1117,9 @@ The following modes are supported:
1113
1117
  Summarize the record contents of the page directory in a page. If a record
1114
1118
  describer is available, the key of each record will be printed.
1115
1119
 
1120
+ page-illustrate
1121
+ Produce an illustration of the contents of a page.
1122
+
1116
1123
  END_OF_USAGE
1117
1124
 
1118
1125
  exit exit_code
@@ -973,7 +973,6 @@ class Innodb::Page::Index < Innodb::Page
973
973
  :info => "Supremum",
974
974
  })
975
975
 
976
-
977
976
  directory_slots.times do |n|
978
977
  yield({
979
978
  :offset => pos_directory - (n * 2),
@@ -1002,7 +1001,7 @@ class Innodb::Page::Index < Innodb::Page
1002
1001
 
1003
1002
  yield({
1004
1003
  :offset => record.offset,
1005
- :length => record.length,
1004
+ :length => record.length || 1,
1006
1005
  :name => :record_data,
1007
1006
  :info => "Record Data",
1008
1007
  })
@@ -67,11 +67,22 @@ class Innodb::Page::Inode < Innodb::Page
67
67
  inodes_per_page.times do |n|
68
68
  inode_cursor.name("inode[#{n}]") do |c|
69
69
  this_inode = Innodb::Inode.new_from_cursor(@space, c)
70
- yield this_inode if this_inode.allocated?
70
+ yield this_inode
71
71
  end
72
72
  end
73
73
  end
74
74
 
75
+ # Iterate through all allocated inodes in the inode array.
76
+ def each_allocated_inode
77
+ unless block_given?
78
+ return enum_for(:each_allocated_inode)
79
+ end
80
+
81
+ each_inode do |this_inode|
82
+ yield this_inode if this_inode.allocated?
83
+ end
84
+ end
85
+
75
86
  def each_region
76
87
  unless block_given?
77
88
  return enum_for(:each_region)
@@ -89,12 +100,21 @@ class Innodb::Page::Inode < Innodb::Page
89
100
  })
90
101
 
91
102
  each_inode do |inode|
92
- yield({
93
- :offset => inode.offset,
94
- :length => Innodb::Inode::SIZE,
95
- :name => :inode,
96
- :info => "Inode",
97
- })
103
+ if inode.allocated?
104
+ yield({
105
+ :offset => inode.offset,
106
+ :length => Innodb::Inode::SIZE,
107
+ :name => :inode_used,
108
+ :info => "Inode (used)",
109
+ })
110
+ else
111
+ yield({
112
+ :offset => inode.offset,
113
+ :length => Innodb::Inode::SIZE,
114
+ :name => :inode_free,
115
+ :info => "Inode (free)",
116
+ })
117
+ end
98
118
  end
99
119
 
100
120
  nil
data/lib/innodb/space.rb CHANGED
@@ -307,7 +307,7 @@ class Innodb::Space
307
307
 
308
308
  each_inode_list.each do |name, list|
309
309
  list.each do |page|
310
- page.each_inode do |inode|
310
+ page.each_allocated_inode do |inode|
311
311
  yield inode
312
312
  end
313
313
  end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module Innodb
4
- VERSION = "0.9.5"
4
+ VERSION = "0.9.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: innodb_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-04-02 00:00:00.000000000 Z
13
+ date: 2014-04-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bindata