るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file lstat
  4. file size
  5. file chmod

モジュール

キーワード

検索結果

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

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...
...Time
Ruby が起動してから GC が起動するまでに経過した時間
: Use Size
ヒープ内での使用サイズ
: Total Size
ヒープ全体のサイズ
: Total Object
ヒープ内に存在するオブジェクトの個数
: GC Time
GC の処理時間

@see GC::Profiler.report...

GC::Profiler.report(out = $stdout) -> nil (3024.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 Si...
...ze(byte) Total Object GC Time(ms)
# 1 0.019 303720 1269840 31746 1.25899999999999967493
//}

@see GC::Profiler.result...

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

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

...生ごとに Hash の配列
(:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ
ていない場合は nil を返します。

例:

GC::Profiler.enable
GC.start
GC::Profiler.raw_data
# => [
{
:GC_TIME=>1.3000000000000858e-05,
:GC_INVOKE_TIM...
...GC_PROFILE_MORE_DETAIL を有効にして Ruby をビルドした場合、以下の
キーも参照できます。

* :GC_MARK_TIME
* :GC_SWEEP_TIME
* :ALLOCATE_INCREASE
* :ALLOCATE_LIMIT
* :HEAP_USE_SLOTS
* :HEAP_LIVE_OBJECTS
* :HEAP_FREE_OBJECTS
* :HAVE_FINALIZE

@see GC::Profiler.report,...
...GC::Profiler.result...

Kernel.#test(cmd, file1, file2) -> bool (230.0)

2ファイル間のファイルテストを行います。

...文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定...
...イル1とファイル2が同一のファイルである

//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result
= test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}

# => =: true
# => <: false
# => >: false
# => -: false...

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (115.0)

単体のファイルでファイルテストを行います。

...るいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していない...
...me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time

//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}...

絞り込み条件を変える