Class: Groonga::DatabaseInspector::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga/database-inspector.rb

Instance Method Summary collapse

Constructor Details

#initialize(database, options, output) ⇒ Reporter

Returns a new instance of Reporter.



67
68
69
70
71
72
73
# File 'lib/groonga/database-inspector.rb', line 67

def initialize(database, options, output)
  @database = database
  @context = @database.context
  @options = options
  @output = output
  @indent_width = 0
end

Instance Method Details

#reportObject



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/groonga/database-inspector.rb', line 75

def report
  write("Database\n")
  indent do
    write("Path:             #{inspect_path(@database.path)}\n")
    write("Total disk usage: " +
          "#{inspect_disk_usage(total_disk_usage)}\n")
    write("Disk usage:       " +
          "#{inspect_sub_disk_usage(@database.disk_usage)}\n")
    write("N records:        #{count_total_n_records}\n")
    write("N tables:         #{count_n_tables}\n")
    write("N columns:        #{count_total_n_columns}\n")
    report_plugins
    report_tables
  end
end