<?php
namespace App\Entity;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*
* @ORM\Table(
* name="command_run_summaries",
* indexes={
*
* @ORM\Index(name="command_name_started_at_idx", columns={"command_name", "started_at"})
* }
* )
*/
class CommandRunSummary
{
/**
* @var string
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
*
* @ORM\Column(name="id", type="guid")
*
* @ORM\Id
*/
protected $id;
/**
* @var string
*
* @ORM\Column(name="command_name", type="string", length=512, nullable=false)
*/
protected $commandName;
/**
* @var string
*
* @ORM\Column(name="arguments", type="string", length=1024, nullable=false)
*/
protected $arguments;
/**
* @var string
*
* @ORM\Column(name="options", type="string", length=1024, nullable=false)
*/
protected $options;
/**
* @var string
*
* @ORM\Column(name="hostname", type="string", length=1024, nullable=false)
*/
protected $hostname;
/**
* @var string
*
* @ORM\Column(name="envvars", type="string", length=8192, nullable=false)
*/
protected $envvars;
/**
* @var DateTime
*
* @ORM\Column(name="started_at", type="datetime", nullable=false)
*/
protected $startedAt;
/**
* @var ?DateTime
*
* @ORM\Column(name="finished_at", type="datetime", nullable=true)
*/
protected $finishedAt;
/**
* @var bool
*
* @ORM\Column(name="finished_due_to_no_initial_lock", type="boolean", nullable=false)
*/
protected $finishedDueToNoInitialLock;
/**
* @var bool
*
* @ORM\Column(name="finished_due_to_got_behind_lock", type="boolean", nullable=false)
*/
protected $finishedDueToGotBehindLock;
/**
* @var bool
*
* @ORM\Column(name="finished_due_to_failed_to_update_lock", type="boolean", nullable=false)
*/
protected $finishedDueToFailedToUpdateLock;
/**
* @var bool
*
* @ORM\Column(name="finished_due_to_rollout_signal", type="boolean", nullable=false)
*/
protected $finishedDueToRolloutSignal;
/**
* @var bool
*
* @ORM\Column(name="finished_normally", type="boolean", nullable=false)
*/
protected $finishedNormally;
/**
* @var int
*
* @ORM\Column(name="number_of_handled_elements", type="integer", nullable=false)
*/
protected $numberOfHandledElements;
/**
* @var int|null
*/
protected $expectedNumberOfElementsToHandle;
/**
* @var int
*
* @ORM\Column(name="max_allocated_memory", type="integer", nullable=false)
*/
protected $maxAllocatedMemory;
public function __construct(
string $commandName,
string $arguments,
string $options,
DateTime $startedAt
) {
$this->commandName = $commandName;
$this->arguments = $arguments;
$this->options = $options;
$this->hostname = (string)gethostname();
$this->envvars = (string)json_encode(getenv());
$this->startedAt = $startedAt;
$this->finishedDueToNoInitialLock = false;
$this->finishedDueToGotBehindLock = false;
$this->finishedDueToFailedToUpdateLock = false;
$this->finishedDueToRolloutSignal = false;
$this->finishedNormally = false;
$this->numberOfHandledElements = 0;
$this->maxAllocatedMemory = 0;
}
public function getId(): string
{
return $this->id;
}
public function getCommandName(): string
{
return $this->commandName;
}
public function getArguments(): string
{
return $this->arguments;
}
public function getOptions(): string
{
return $this->options;
}
public function setFinishedAt(?DateTime $finishedAt): void
{
$this->finishedAt = $finishedAt;
}
public function setFinishedDueToNoInitialLock(bool $finishedDueToNoInitialLock): void
{
$this->finishedDueToNoInitialLock = $finishedDueToNoInitialLock;
}
public function setFinishedDueToGotBehindLock(bool $finishedDueToGotBehindLock): void
{
$this->finishedDueToGotBehindLock = $finishedDueToGotBehindLock;
}
public function setFinishedDueToFailedToUpdateLock(bool $finishedDueToFailedToUpdateLock): void
{
$this->finishedDueToFailedToUpdateLock = $finishedDueToFailedToUpdateLock;
}
public function setFinishedDueToRolloutSignal(bool $finishedDueToRolloutSignal): void
{
$this->finishedDueToRolloutSignal = $finishedDueToRolloutSignal;
}
public function setFinishedNormally(bool $finishedNormally): void
{
$this->finishedNormally = $finishedNormally;
}
public function getExpectedNumberOfElementsToHandle(): ?int
{
return $this->expectedNumberOfElementsToHandle;
}
public function setExpectedNumberOfElementsToHandle(?int $expectedNumberOfElementsToHandle): void
{
$this->expectedNumberOfElementsToHandle = $expectedNumberOfElementsToHandle;
}
public function setNumberOfHandledElements(int $numberOfHandledElements): void
{
$this->numberOfHandledElements = $numberOfHandledElements;
}
public function getNumberOfHandledElements(): int
{
return $this->numberOfHandledElements;
}
public function setMaxAllocatedMemory(int $maxAllocatedMemory): void
{
$this->maxAllocatedMemory = $maxAllocatedMemory;
}
public function getMaxAllocatedMemory(): int
{
return $this->maxAllocatedMemory;
}
}