Fast/Profile/Base.pm

filter: Statementstmt 90.7% 49 / 54 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.3% 12 / 13 Podpod 57.1% 4 / 7 totaltotal 88.4% 69 / 78 CC 3 SCAR 2.7
CC
3
Cov
91%
enabled
2.0
slow_query
2.0
_output_meta
1.6
CRAP 1.3
« Fast/Cache/Redis.pm ↑ Summary Fast/Profile/mysql.pm »
1 package DBIx::Fast::Profile::Base;
2  
3 5 ▶use v5.38;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Object::Pad 0.807;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 our $VERSION = '0.21';
7 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use DBIx::Fast::Output;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 class DBIx::Fast::Profile::Base :does(DBIx::Fast::Output) {
12 1 ▶ field $dbix :param :reader;
Subroutine dbix: called CC=1 SCAR=0.0
Pod undocumented
13 6 field $enabled :param :accessor = 1;
14 6 ▶ field $slow_query :param :accessor = 1.0;
Subroutine enabled: called CC=2 SCAR=6.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
@_ and $enabled = shift() 2 4 6
15  
16 4 ▶ ADJUST {
Subroutine slow_query: called CC=2 SCAR=6.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
@_ and $slow_query = shift() 1 3 4
17 croak "Missing required parameter 'dbix'" unless defined $dbix;
18 weaken($dbix);
19 }
20  
21 # Envelope identity for DBIx::Fast::Output events.
22 0 ▶ method _output_meta () {
Subroutine _output_meta: not called CC=1 SCAR=4.6
23 0 (my $driver = ref $self) =~ s/^.*:://;
24 0 return { source => 'profile', driver => $driver };
25 5 }
26  
27 5 method add_query { }
28 1 ▶ method init { croak "Not implemented" }
Subroutine init: called CC=1 SCAR=0.0
Pod documented
29 1 ▶ method get_slow_queries { croak "Not implemented" }
Subroutine get_slow_queries: called CC=1 SCAR=0.0
Pod documented
30 1 ▶ method get_stats { croak "Not implemented" }
Subroutine get_stats: called CC=1 SCAR=0.0
Pod documented
31 1 ▶ method print_stats { croak "Not implemented" }
Subroutine print_stats: called CC=1 SCAR=0.0
Pod documented
32  
33 # Driver-specific diagnostics. Default to no-ops (return undef) so a driver
34 # with no native equivalent (e.g. SQLite) inherits them without re-stubbing
35 # each one, and adding a new diagnostic to one driver does not make the
36 # others croak. ::MariaDB overrides these with real implementations.
37 5 method get_query_profile { }
38 5 method explain_query { }
39 5 method get_table_stats { }
40 5 method get_index_stats { }
41 5 method analyze_indexes { }
42 5 method print_index_analysis { }
43 5 method get_index_metrics { }
44 5 method monitor_connections { }
45 5 method get_current_connections { }
46 5 method get_processes { }
47 5 method print_connection_monitor { }
48 5 method start_connection_monitor { }
49 }
50  
51 5 1;
52  
53 __END__
« Fast/Cache/Redis.pm ↑ Summary Fast/Profile/mysql.pm »