Topic: ChannelLogs count
So, I took the logs on all the channels I have access to, and did a little headcount. This was on Sunday 2012-08-19, midnight to midnight.
I counted 339 unique agents. Just an interesting tidbit I'd thought I should share. I'll be watching the logs for another week or so, if my computer stays alive in this heat.
Code used:
<?php
$files = scandir('logs');
unset($files[0], $files[1]);
$date = '';
$data = array();
foreach($files as $file) {
// echo 'Reading: ' . $file . '<br />';
$contents = file_get_contents('logs/' . $file);
$lines = explode("\n", $contents);
foreach($lines as $line) {
if (preg_match("/^Log starting: (\d+\-\d+\-\d+) \d+:\d+:\d+/", trim($line), $match)) {
$date = $match[1];
}
if (preg_match("/^\[\d+:\d+:\d+] \* (.+) is now (.+).$/", trim($line), $match)) {
@$data[$date][$match[1]] ++;
}
}
}
foreach($data as $date => $agents) {
echo $date . ' ' . count($agents) . '<br />';
}