MCPcopy Create free account
hub / github.com/TrunkRecorder/trunk-recorder / parsefile

Function parsefile

examples/decodechart.php:44–51  ·  view source on GitHub ↗

parser for "Control Channel Message Decode Rate" lines from log files; creates array of $decode[date/time][system][rate]

($filename)

Source from the content-addressed store, hash-verified

42$decode = array();
43//parser for "Control Channel Message Decode Rate" lines from log files; creates array of $decode[date/time][system][rate]
44function parsefile($filename) {
45 global $decode;
46 preg_match_all("/\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}).*\[(.*)\].*Control Channel Message Decode Rate: (.*)\/sec/", file_get_contents($filename), $logfile);
47 foreach ($logfile[1] as $theentry => $datetime)
48 $decode[$datetime][$logfile[2][$theentry]] = $logfile[3][$theentry];
49 //if (isset($decode[1][$theentry-1]) && ($datetime == $decode[1][$theentry-1]))
50 unset($theentry, $datetime);
51}
52
53
54//get the file names from URL

Callers 1

decodechart.phpFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected