| 1 | package DBIx::OpenTracing::Constants; | ||
| 2 | 7 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 7 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 7 | ▶ | use parent 'Exporter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 7 | ▶ | use Package::Constants; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | use constant { | ||
| 8 | 7 | DB_TAG_TYPE => 'db.type', | |
| 9 | DB_TAG_SQL => 'db.statement', | ||
| 10 | DB_TAG_SQL_SUMMARY => 'db.statement_summary', | ||
| 11 | DB_TAG_BIND => 'db.bind_values', | ||
| 12 | DB_TAG_USER => 'db.user', | ||
| 13 | DB_TAG_DBNAME => 'db.instance', | ||
| 14 | DB_TAG_ROWS => 'db.rows', | ||
| 15 | DB_TAG_CALLER_SUB => 'caller.subname', | ||
| 16 | DB_TAG_CALLER_FILE => 'caller.file', | ||
| 17 | DB_TAG_CALLER_LINE => 'caller.line', | ||
| 18 | DB_TAG_CALLER_PACKAGE => 'caller.package', | ||
| 19 | 7 | ▶ | }; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | |||
| 21 | 7 | use constant DB_TAGS_ALL => ( | |
| 22 | DB_TAG_TYPE, | ||
| 23 | DB_TAG_SQL, DB_TAG_SQL_SUMMARY, | ||
| 24 | DB_TAG_BIND, DB_TAG_USER, | ||
| 25 | DB_TAG_DBNAME, DB_TAG_ROWS, | ||
| 26 | DB_TAG_CALLER_SUB, DB_TAG_CALLER_FILE, | ||
| 27 | DB_TAG_CALLER_LINE, DB_TAG_CALLER_PACKAGE, | ||
| 28 | 7 | ▶ | ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | 7 | our @EXPORT_OK = Package::Constants->list(__PACKAGE__); | |
| 31 | 7 | our %EXPORT_TAGS = (ALL => \@EXPORT_OK); | |
| 32 | |||
| 33 | 7 | 1; | |
| 34 | __END__ | ||
| 35 | =pod | ||
| 36 | |||
| 37 | =head1 NAME | ||
| 38 | |||
| 39 | DBIx::OpenTracing::Constants - name for use with DBIx::OpenTracing | ||
| 40 | |||
| 41 | =head1 SYNOPSIS | ||
| 42 | |||
| 43 | use DBIx::OpenTracing::Constants ':ALL'; | ||
| 44 | |||
| 45 | DBIx::OpenTracing->hide_tags(DB_TAG_SQL); | ||
| 46 | |||
| 47 | =head1 EXPORTED CONSTANTS | ||
| 48 | |||
| 49 | This module exports the following constants | ||
| 50 | (C<:ALL> tag is supported to get them all): | ||
| 51 | |||
| 52 | =over 4 | ||
| 53 | |||
| 54 | =item DB_TAG_TYPE | ||
| 55 | |||
| 56 | The database type (usually "sql"). | ||
| 57 | |||
| 58 | =item DB_TAG_SQL | ||
| 59 | |||
| 60 | The SQL statement of the current query. | ||
| 61 | |||
| 62 | =item DB_TAG_BIND | ||
| 63 | |||
| 64 | Bind values of the current query. | ||
| 65 | |||
| 66 | =item DB_TAG_USER | ||
| 67 | |||
| 68 | Username used to connect to database. | ||
| 69 | |||
| 70 | =item DB_TAG_DBNAME | ||
| 71 | |||
| 72 | The database name. | ||
| 73 | |||
| 74 | =item DB_TAG_ROWS | ||
| 75 | |||
| 76 | Number of rows returned by the query. | ||
| 77 | |||
| 78 | =item DB_TAGS_ALL | ||
| 79 | |||
| 80 | A list with all possible tag names. | ||
| 81 | |||
| 82 | =back | ||
| 83 | |||
| 84 | =cut | ||