public function storeTubeStats(QueueRepo $queue)
    {
        $history = History::firstOrNew(['date' => date('Y-m-d'),
                                        'hour' => date('H'),
                                        'queue_id' => $queue->id]);

        $history->pending_count = $this->getPendingJobsCount($queue);
        $history->failed_count = $this->getFailedJobsCount($queue);

        $history->exception_count += Cache::pull('eyewitness_q_exception_count_'.$queue->id);
        $history->process_count += Cache::pull('eyewitness_q_process_count_'.$queue->id);
        $history->process_time += Cache::pull('eyewitness_q_process_time_'.$queue->id);
        $history->sonar_time += Cache::pull('eyewitness_q_sonar_time_'.$queue->id);
        $history->sonar_count += Cache::pull('eyewitness_q_sonar_count_'.$queue->id);
        $history->idle_time += Cache::pull('eyewitness_q_idle_time_'.$queue->id);

        $deploy = Cache::get('eyewitness_q_sonar_deployed_'.$queue->id, null);
        if (is_null($deploy)) {
            $history->sonar_deployed = null;
        } else {
            $history->sonar_deployed = time()-$deploy;
        }

        $history->save();
    }