Class: LogStruct::Log::GoodJob::Finish
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::GoodJob::Finish
- Extended by:
- T::Sig
- Includes:
- Interfaces::CommonFields, Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/good_job/finish.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Array<T.untyped>?
readonly
Returns the value of prop
arguments. -
#duration_ms ⇒ Float
readonly
Event-specific fields.
-
#event ⇒ Event
readonly
Returns the value of prop
event. -
#executions ⇒ Integer?
readonly
Returns the value of prop
executions. -
#finished_at ⇒ Time
readonly
Returns the value of prop
finished_at. -
#job_class ⇒ String?
readonly
Returns the value of prop
job_class. -
#job_id ⇒ String?
readonly
Returns the value of prop
job_id. -
#level ⇒ Level
readonly
Returns the value of prop
level. -
#process_id ⇒ Integer
readonly
Returns the value of prop
process_id. -
#queue_name ⇒ Symbol?
readonly
Returns the value of prop
queue_name. -
#result ⇒ String?
readonly
Returns the value of prop
result. -
#source ⇒ Source::Job
readonly
Shared/common fields.
-
#thread_id ⇒ String
readonly
Returns the value of prop
thread_id. -
#timestamp ⇒ Time
readonly
Returns the value of prop
timestamp.
Instance Method Summary collapse
- #initialize(source: Source::Job, event: Event::Finish, timestamp:, level: Level::Info, job_id: nil, job_class: nil, queue_name: nil, arguments: nil, executions: nil, duration_ms:, finished_at:, process_id:, thread_id:, result: nil) ⇒ void constructor
- #to_h ⇒ Hash{LogStruct::LogField => T.untyped}
Methods included from Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Constructor Details
#initialize(source: Source::Job, event: Event::Finish, timestamp:, level: Level::Info, job_id: nil, job_class: nil, queue_name: nil, arguments: nil, executions: nil, duration_ms:, finished_at:, process_id:, thread_id:, result: nil) ⇒ void
|
|
# File '' const :source, Source::Job, default: Source::Job const :event, Event, default: Event::Finish const :timestamp, Time, factory: -> { Time.now } const :level, Level, default: Level::Info const :job_id, T.nilable(String), default: nil const :job_class, T.nilable(String), default: nil const :queue_name, T.nilable(Symbol), default: nil const :arguments, T.nilable(T::Array[T.untyped]), default: nil const :executions, T.nilable(Integer), default: nil const :duration_ms, Float const :finished_at, Time const :process_id, Integer const :thread_id, String const :result, T.nilable(String), default: nil |
Instance Attribute Details
#arguments ⇒ Array<T.untyped>? (readonly)
Returns the value of prop arguments.
|
|
# File '' const :arguments, T.nilable(T::Array[T.untyped]), default: nil |
#duration_ms ⇒ Float (readonly)
Event-specific fields
|
|
# File '' const :duration_ms, Float |
#event ⇒ Event (readonly)
Returns the value of prop event.
|
|
# File '' const :event, Event, default: Event::Finish |
#executions ⇒ Integer? (readonly)
Returns the value of prop executions.
|
|
# File '' const :executions, T.nilable(Integer), default: nil |
#finished_at ⇒ Time (readonly)
Returns the value of prop finished_at.
|
|
# File '' const :finished_at, Time |
#job_class ⇒ String? (readonly)
Returns the value of prop job_class.
|
|
# File '' const :job_class, T.nilable(String), default: nil |
#job_id ⇒ String? (readonly)
Returns the value of prop job_id.
|
|
# File '' const :job_id, T.nilable(String), default: nil |
#level ⇒ Level (readonly)
Returns the value of prop level.
|
|
# File '' const :level, Level, default: Level::Info |
#process_id ⇒ Integer (readonly)
Returns the value of prop process_id.
|
|
# File '' const :process_id, Integer |
#queue_name ⇒ Symbol? (readonly)
Returns the value of prop queue_name.
|
|
# File '' const :queue_name, T.nilable(Symbol), default: nil |
#result ⇒ String? (readonly)
Returns the value of prop result.
|
|
# File '' const :result, T.nilable(String), default: nil |
#source ⇒ Source::Job (readonly)
Shared/common fields
|
|
# File '' const :source, Source::Job, default: Source::Job |
#thread_id ⇒ String (readonly)
Returns the value of prop thread_id.
|
|
# File '' const :thread_id, String |
#timestamp ⇒ Time (readonly)
Returns the value of prop timestamp.
|
|
# File '' const :timestamp, Time, factory: -> { Time.now } |
Instance Method Details
#to_h ⇒ Hash{LogStruct::LogField => T.untyped}
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/log_struct/log/good_job/finish.rb', line 50 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::JobId] = job_id unless job_id.nil? h[LogField::JobClass] = job_class unless job_class.nil? h[LogField::QueueName] = queue_name unless queue_name.nil? h[LogField::Arguments] = arguments unless arguments.nil? h[LogField::Executions] = executions unless executions.nil? h[LogField::DurationMs] = duration_ms h[LogField::FinishedAt] = finished_at h[LogField::ProcessId] = process_id h[LogField::ThreadId] = thread_id h[LogField::Result] = result unless result.nil? h end |