<commit_before><?php

namespace Stat\GeneralBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller {

    public function indexAction() {
        # Get stat
        $rep = $this->getDoctrine()
            ->getRepository('StatGeneralBundle:Realtime');
        
        $time = time() - 60 * 60 * 24;
        $dt = new \DateTime();
        $dt->setTimestamp($time);

        $query = $rep->createQueryBuilder('p')
            ->where("p.createdAt > :time")
            ->setParameter('time', $dt->format('Y-m-d H:i'))
            ->getQuery();

        $rstat = $query->getResult();
        
        $realtime = array();
        $banks = array();

        $mc = $this->get('beryllium_cache');

        foreach ($rstat as $s) {
            $game = $s->getGame();

            $realtime[ $game ][ $s->getCreatedAt('epoch') * 1000 ] = array(
                'hit' => $s->getHit(), 'uniq' => $s->getUniq(), 'new_users' => $s->getNewUsers(),
                'transactions_count' => $s->getTransactionsCount(), 'money' => $s->getMoney(), 'payers' => $s->getPayer()
            );

            $bank = $mc->get("gb-$game") ? $mc->get("gb-$game") : 0;
            $banks[ $game ] = $bank;
        }

        return $this->render('StatGeneralBundle:Default:index.html.twig', array(
            'realtime' => $realtime,
            'banks' => $banks
        ));
    }


    public function hoursAction() {
        # Get stat
        $rep = $this->getDoctrine()
            ->getRepository('StatGeneralBundle:Hour');
        
        $dt = new \DateTime();
        $dt->setTimestamp( time() );

        $query = $rep->createQueryBuilder('p')
            ->where("p.created_at > :time")
            ->setParameter('time', $dt->format('Y-m-d 00:00'))
            ->getQuery();

        $rstat = $query->getResult();

        
        $hour = array();<commit_msg>bonus fix<commit_after><?php

namespace Stat\GeneralBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller {

    public function indexAction() {
        # Get stat
        $rep = $this->getDoctrine()
            ->getRepository('StatGeneralBundle:Realtime');
        
        $time = time() - 60 * 60 * 24;
        $dt = new \DateTime();
        $dt->setTimestamp($time);

        $query = $rep->createQueryBuilder('p')
            ->where("p.createdAt > :time")
            ->setParameter('time', $dt->format('Y-m-d H:i'))
            ->getQuery();

        $rstat = $query->getResult();
        
        $realtime = array();
        $banks = array();

        $mc = $this->get('beryllium_cache');

        foreach ($rstat as $s) {
            $game = $s->getGame();

            $realtime[ $game ][ $s->getCreatedAt('epoch') * 1000 ] = array(
                'hit' => $s->getHit(), 'uniq' => $s->getUniq(), 'new_users' => $s->getNewUsers(),
                'transactions_count' => $s->getTransactionsCount(), 'money' => $s->getMoney(), 'payers' => $s->getPayer(),
                'bonus_time' => $s->getBonusTime()
            );

            $bank = $mc->get("gb-$game") ? $mc->get("gb-$game") : 0;
            $banks[ $game ] = $bank;
        }

        return $this->render('StatGeneralBundle:Default:index.html.twig', array(
            'realtime' => $realtime,
            'banks' => $banks
        ));
    }


    public function hoursAction() {
        # Get stat
        $rep = $this->getDoctrine()
            ->getRepository('StatGeneralBundle:Hour');
        
        $dt = new \DateTime();
        $dt->setTimestamp( time() );

        $query = $rep->createQueryBuilder('p')
            ->where("p.created_at > :time")
            ->setParameter('time', $dt->format('Y-m-d 00:00'))
            ->getQuery();

        $rstat = $query->getResult();

        
        $hour = array();
{'fraction_non_alphanumeric': 0.18617844249613202, 'fraction_numerical': 0.007735946364105209, 'mean_word_length': 1.9655963302752293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 85, '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': '5040820', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1159, 'n_words': 210}