<?php

declare(strict_types=1);

namespace Drupal\flowdrop_runtime\Event;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched when a node execution is recorded by the monitor.
 *
 * @internal
 */
class MonitoringNodeExecutionEvent extends Event {

  /**
   * The event name.
   */
  const NAME = 'flowdrop_runtime.monitoring.node_execution';

  /**
   * Constructs a new MonitoringNodeExecutionEvent.
   *
   * @param string $nodeId
   *   The node ID.
   * @param string $executionId
   *   The execution ID.
   * @param array $metrics
   *   The node execution metrics.
   * @param int $timestamp
   *   The event timestamp.
   */
  public function __construct(
    public readonly string $nodeId,
    public readonly string $executionId,
    public readonly array $metrics,
    public readonly int $timestamp,
  ) {}

}
