new filehandle at the beginning of each request.
use DBI::Log timing => 1, trace => 1, format => 'json', file => '/dev/null';
# Ick - find a better way to pass this around than a global var!
my $dbi
open $path to write - $!");
# Write our metadata to the log first
print {$dbilog_fh} JSON::to_json(
{
logged_by => __PACKAGE__ . "/$VERSION",
method => $c
int keeping the log, so we should delete it.
seek $DBI::Log::opts{fh}, 0, 0;
my $metadata_json = <$DBI::Log::opts{fh}>;
my $first_query = <$DBI::Log::opts{fh}>;
if (!$first_query) {
hift;
my @json_lines = path($file)->lines;
my %stats;
# The file is line-delimited JSON, where each line is a separate
# JSON object, so we need to read each line as JSON separately.
cessed.
my $metadata_json = shift @json_lines;
%stats = %{ JSON::from_json($metadata_json) };
for my $line (@json_lines) {
my $line_data = JSON::from_json($line);
$stats{q
uery</th>
<th>Took</th>
<th>Stack</th>
</tr>
HTML
for my $json_line ($profile_path->lines) {
my $data = JSON::from_json($json_line);
# Find first useful line of the stack (knowin