るりまサーチ (Ruby 2.5.0)

最速Rubyリファレンスマニュアル検索!
8件ヒット [1-8件を表示] (0.248秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

キーワード

検索結果

GC::Profiler.report(out = $stdout) -> nil (78328.0)

GC::Profiler.result の結果を out に出力します。

GC::Profiler.result の結果を out に出力します。

@param out 結果の出力先を指定します。デフォルトは $stdout です。

//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.report

# => GC 4 invokes.
# Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)
# 1...

Thread#report_on_exception -> bool (42421.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトはスレッド作成時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Th...

Thread#report_on_exception=(newstate) (42421.0)

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトはスレッド作成時の Thread.report_on_exception です。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。

//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Th...

Thread.report_on_exception -> bool (42367.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトは true です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro...

Thread.report_on_exception=(newstate) (42367.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトは true です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro...

絞り込み条件を変える

GC::Profiler.clear -> nil (24043.0)

蓄積している GC のプロファイル情報をすべて削除します。

蓄積している GC のプロファイル情報をすべて削除します。

例:
GC::Profiler.enable
GC.start
GC.start
GC::Profiler.report #=> 2 回分の GC のプロファイル情報出力する。
GC::Profiler.clear
GC.start
GC::Profiler.report #=> 1 回分の GC のプロファイル情報出力する。

GC::Profiler.raw_data -> [Hash, ...] | nil (24025.0)

GC のプロファイル情報を GC の発生ごとに Hash の配列 (:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ ていない場合は nil を返します。

GC のプロファイル情報を GC の発生ごとに Hash の配列
(:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ
ていない場合は nil を返します。

例:

GC::Profiler.enable
GC.start
GC::Profiler.raw_data
# => [
{
:GC_TIME=>1.3000000000000858e-05,
:GC_INVOKE_TIME=>0.010634999999999999,
:HEAP_USE_SIZE=>289640,
...

GC::Profiler.result -> String (24025.0)

GC のプロファイル情報をフォーマットし、文字列として返します。

GC のプロファイル情報をフォーマットし、文字列として返します。

プロファイル情報は、GC の発生ごとに集計します。
以下は、5 回 GC が発生した場合の実行例です。

$ ruby -e "GC::Profiler.enable; a = Array.new(100000){ 'aa' }; puts GC::Profiler.result"
GC 5 invokes.
Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object ...