<?php

declare(strict_types=1);

namespace App\Framework\Discovery\Memory;

use App\Framework\Core\ValueObjects\Byte;
use App\Framework\Discovery\ValueObjects\MemoryStrategy;

/**
 * Batch processing parameters
 */
final readonly class BatchParameters
{
    public function __construct(
        public int            $chunkSize,
        public int            $batchCount,
        public Byte           $estimatedMemoryPerBatch,
        public MemoryStrategy $strategy
    ) {
    }

    public function toArray(): array
    {
        return [
            'chunk_size' => $this->chunkSize,
            'batch_count' => $this->batchCount,
            'estimated_memory_per_batch' => $this->estimatedMemoryPerBatch->toHumanReadable(),
            'strategy' => $this->strategy->value,
        ];
    }
}
