<commit_before><?php

/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 2016/04/01
 * Time: 16:43.
 */
namespace script;

use Application\ESGatewayBuilder;
use ESGateway\Factory;
use ESGateway\User;
use PHP_Timer;
use Repository\ESGatewayUserRepo;

/**
 * Class Machine.
 */
class Machine
{
    /** @var string */
    protected $gameVersion;
    /** @var UidAggregator */
    protected $aggregator;
    /** @var array */
    protected $shardList;

    /**
     * Machine constructor.
     *
     * @param string $gameVersion
     * @param string $esHost
     */
    public function __construct($gameVersion, $esHost)
    {
        $this->gameVersion = $gameVersion;
        $this->esHost = $esHost;
        $date = date('Ymd');
        $persist = new AggregatorPersist(LOG_DIR.'/'.$date.'/'.$gameVersion.'.uid.persist');
        $this->aggregator = new UidAggregator($persist);
        $this->shardList = ShardHelper::getShardList($gameVersion);
        $this->logFile = LOG_DIR.'/'.$date.'/'.$gameVersion.'.machine';
    }

    /**
     * @param int $repeatTimes
     * @param int $waitTime
     */
    public function run($repeatTimes, $waitTime)
    {
        $queue = new UidQueue(UID_QUEUE_DIR, $this->gameVersion, $this->shardList);
        $groupedUidList = $queue->pop();
        array_walk($groupedUidList, function (array $uidList, $shardId) {
            if (count($uidList) === 0) {
                return;<commit_msg>no date info injected into aggregator<commit_after><?php

/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 2016/04/01
 * Time: 16:43.
 */
namespace script;

use Application\ESGatewayBuilder;
use ESGateway\Factory;
use ESGateway\User;
use PHP_Timer;
use Repository\ESGatewayUserRepo;

/**
 * Class Machine.
 */
class Machine
{
    /** @var string */
    protected $gameVersion;
    /** @var UidAggregator */
    protected $aggregator;
    /** @var array */
    protected $shardList;

    /**
     * Machine constructor.
     *
     * @param string $gameVersion
     * @param string $esHost
     */
    public function __construct($gameVersion, $esHost)
    {
        $this->gameVersion = $gameVersion;
        $this->esHost = $esHost;
        $date = date('Ymd');
        $persist = new AggregatorPersist(LOG_DIR.'/'.$gameVersion.'.uid.persist');
        $this->aggregator = new UidAggregator($persist);
        $this->shardList = ShardHelper::getShardList($gameVersion);
        $this->logFile = LOG_DIR.'/'.$date.'/'.$gameVersion.'.machine';
    }

    /**
     * @param int $repeatTimes
     * @param int $waitTime
     */
    public function run($repeatTimes, $waitTime)
    {
        $queue = new UidQueue(UID_QUEUE_DIR, $this->gameVersion, $this->shardList);
        $groupedUidList = $queue->pop();
        array_walk($groupedUidList, function (array $uidList, $shardId) {
            if (count($uidList) === 0) {
                return;
{'fraction_non_alphanumeric': 0.15347222222222223, 'fraction_numerical': 0.009027777777777777, 'mean_word_length': 2.6514575411913817, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4985551', 'n_tokens_mistral': 950, 'n_tokens_neox': 940, 'n_words': 188}