Class: FiberAudit::Runtime::SchedulerSnapshot

Inherits:
Data
  • Object
show all
Defined in:
lib/fiber_audit/runtime/scheduler_snapshot.rb

Overview

Immutable scheduler snapshot/context fields captured at operation start. All fields are Boolean or nil only, as per JSONL 1.0 schema requirements.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheduler_present:, fiber_blocking:, scheduler_io_select_supported: nil, scheduler_process_wait_supported: nil, scheduler_address_resolve_supported: nil) ⇒ SchedulerSnapshot

Returns a new instance of SchedulerSnapshot.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 14

def initialize(
  scheduler_present:,
  fiber_blocking:,
  scheduler_io_select_supported: nil,
  scheduler_process_wait_supported: nil,
  scheduler_address_resolve_supported: nil
)
  super(
    scheduler_present: normalize_boolean(scheduler_present, 'scheduler_present'),
    fiber_blocking: normalize_boolean(fiber_blocking, 'fiber_blocking'),
    scheduler_io_select_supported: normalize_optional_boolean(
      scheduler_io_select_supported,
      'scheduler_io_select_supported'
    ),
    scheduler_process_wait_supported: normalize_optional_boolean(
      scheduler_process_wait_supported,
      'scheduler_process_wait_supported'
    ),
    scheduler_address_resolve_supported: normalize_optional_boolean(
      scheduler_address_resolve_supported,
      'scheduler_address_resolve_supported'
    )
  )
end

Instance Attribute Details

#fiber_blockingObject (readonly)

Returns the value of attribute fiber_blocking

Returns:

  • (Object)

    the current value of fiber_blocking



7
8
9
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 7

def fiber_blocking
  @fiber_blocking
end

#scheduler_address_resolve_supportedObject (readonly)

Returns the value of attribute scheduler_address_resolve_supported

Returns:

  • (Object)

    the current value of scheduler_address_resolve_supported



7
8
9
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 7

def scheduler_address_resolve_supported
  @scheduler_address_resolve_supported
end

#scheduler_io_select_supportedObject (readonly)

Returns the value of attribute scheduler_io_select_supported

Returns:

  • (Object)

    the current value of scheduler_io_select_supported



7
8
9
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 7

def scheduler_io_select_supported
  @scheduler_io_select_supported
end

#scheduler_presentObject (readonly)

Returns the value of attribute scheduler_present

Returns:

  • (Object)

    the current value of scheduler_present



7
8
9
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 7

def scheduler_present
  @scheduler_present
end

#scheduler_process_wait_supportedObject (readonly)

Returns the value of attribute scheduler_process_wait_supported

Returns:

  • (Object)

    the current value of scheduler_process_wait_supported



7
8
9
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 7

def scheduler_process_wait_supported
  @scheduler_process_wait_supported
end

Instance Method Details

#to_measurementsObject



39
40
41
42
43
44
45
46
47
# File 'lib/fiber_audit/runtime/scheduler_snapshot.rb', line 39

def to_measurements
  {
    scheduler_present: scheduler_present,
    fiber_blocking: fiber_blocking,
    scheduler_io_select_supported: scheduler_io_select_supported,
    scheduler_process_wait_supported: scheduler_process_wait_supported,
    scheduler_address_resolve_supported: scheduler_address_resolve_supported
  }.freeze
end