0
  B   /ˆl–Ãa¾”êh¥2 ¸&®6â˜´o�þYh+7) ä�n1ˆ þÛ833Ú_‹I|¥�+ýÿ¹ä³ÅÙ A    //*==============================================================================
    Copyright (c) 2005-2010 Joel de Guzman
    Copyright (c) 2010 Thomas Heller

    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_PHOENIX_HPP
#define BOOST_PHOENIX_PHOENIX_HPP

#include <boost/phoenix/core.hpp>
#include <boost/phoenix/debug.hpp>
#include <boost/phoenix/function.hpp>
#include <boost/phoenix/operator.hpp>
#include <boost/phoenix/statement.hpp>
#include <boost/phoenix/object.hpp>
#include <boost/phoenix/scope.hpp>
#include <boost/phoenix/bind.hpp>
#include <boost/phoenix/stl.hpp>
#include <boost/phoenix/fusion.hpp>

#endif
  7   1ˆl–Ãa¾”Ên-jq@=p\ÊbÑ¿�þB Eœn8äqÇÂ!€ÏÝ„u—[wÜÆÚ ?÷     1#!/usr/bin/perl
#
# $Id: mytop,v 1.99-maria8 2025/07/16 17:59:26 jweisbuch Exp $

=pod

=head1 NAME

mytop - display MariaDB/MySQL server performance info like `top'

=cut

## most of the POD is at the bottom of the file

use 5.005;
use strict;
use warnings;
use DBI;
use Getopt::Long;
use Socket;
use List::Util qw(min max);
use File::Basename;

$main::VERSION = "1.99-maria8";
my $path_for_script = dirname($0);

$| = 1;
$0 = 'mytop';

my $WIN = ($^O eq 'MSWin32') ? 1 : 0;

## Test for color support.

eval { require Term::ANSIColor; };

my $HAS_COLOR = $@ ? 0 : 1;

$HAS_COLOR = 0 if $WIN;

## Test of Time::HiRes support

eval { require Time::HiRes };

my $HAS_TIME = $@ ? 0 : 1;

my $debug = 0;

## Try to lower our priority (which, who, pri)

setpriority(0,0,10) unless $WIN;

## Prototypes

sub Clear();
sub GetData();
sub GetQPS();
sub FullQueryInfo($);
sub Explain($);
sub PrintTable(@);
sub PrintHelp();
sub Sum(@);
sub commify($);
sub make_short($);
sub Hashes($);
sub Execute($);
sub StringOrRegex($);
sub GetInnoDBStatus();
sub GetCmdSummary();
sub GetShowVariables();
sub GetShowStatus();
sub cmd_s;
sub cmd_S;
sub cmd_q;

## Default Config Values

my %config = (
    batchmode     => 0,
    color         => 1,
    db            => '',
    database      => '',
    delay         => 5,
    filter_user   => qr/.?/,
    filter_db     => qr/.?/,
    filter_host   => qr/.?/,
    filter_state  => qr/.?/,
    header        => 1,
    help          => 0,
    host          => 'localhost',
    idle          => 1,
    long          => 120,
    long_nums     => 0,
    mode          => 'top',
    prompt        => 0,
    pass          => '',
    password      => '',
    port          => 3306,
    resolve       => 0,
    slow          => 10,        ## slow query time
    socket        => '',
    sort          => 1,         ## default or reverse sort ("s")
    user          => 'root',
    fullqueries   => 0,         ## shows untruncated queries
    usercol_width => 8,         ## User column width
    dbcol_width   => 9,         ## DB column width
    hide_progress => 0          ## hide the "%" column when available
);

my %qcache = ();    ## The query cache--used for full query info support.
my %ucache = ();    ## The user cache--used for full killing by user
my %dbcache = ();   ## The db cache.  This should be merged at some point.
my %statcache = (); ## The show status cache for GetShowStatus()

my (%STATUS, %OLD_STATUS); # header stuff.

my $CLEAR = $WIN ? '': `clear`;

## Term::ReadKey values

my $RM_RESET   = 0;
my $RM_NOBLKRD = 3; ## using 4 traps Ctrl-C :-(

## Add options from .my.cnf first

my $my_print_defaults;
if (!defined($my_print_defaults=my_which("my_print_defaults")))
{
  print "Warning: Can't find my_print_defaults. Please add it to your PATH!\n";
  exit(1);
}

unshift @ARGV, split "\n", `$my_print_defaults client mytop`;

## Read the user's config file, if it exists.

my $config = "$ENV{HOME}/.mytop";

if (-e $config)
{
    if (open CFG, "<$config")
    {
        while (<CFG>)
        {
            next if /^\s*($|#)/;  ## skip blanks and comments

  