Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm |
Statements | Executed 4257 statements in 22.8ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2123434 | 4 | 1 | 388ms | 388ms | CORE:match (opcode) | JSON::Schema::Modern::
87311 | 1 | 1 | 124ms | 124ms | CORE:qr (opcode) | JSON::Schema::Modern::
87311 | 1 | 1 | 117ms | 117ms | CORE:regcomp (opcode) | JSON::Schema::Modern::
128937 | 4 | 1 | 104ms | 104ms | CORE:sort (opcode) | JSON::Schema::Modern::
4217 | 1 | 1 | 22.2ms | 90.1ms | __ANON__[:39] | JSON::Schema::Modern::Error::
1 | 1 | 1 | 9.82ms | 13.3ms | BEGIN@18 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 1.60ms | 14.1ms | BEGIN@21 | JSON::Schema::Modern::Error::
26 | 2 | 1 | 50µs | 50µs | CACHED_METASCHEMAS (xsub) | JSON::Schema::Modern::
126 | 3 | 1 | 33µs | 33µs | CORE:subst (opcode) | JSON::Schema::Modern::
1 | 1 | 1 | 29µs | 1.45ms | BEGIN@11 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 28µs | 31µs | BEGIN@1.66 | JSON::Schema::Modern::
1 | 1 | 1 | 22µs | 63µs | BEGIN@13 | JSON::Schema::Modern::Error::
15 | 1 | 1 | 22µs | 22µs | METASCHEMA_URIS (xsub) | JSON::Schema::Modern::
1 | 1 | 1 | 18µs | 18µs | BEGIN@9 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 17µs | 43µs | BEGIN@14 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 14µs | 910µs | BEGIN@19 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 13µs | 30µs | BEGIN@15 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 13µs | 30µs | BEGIN@16 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 12µs | 186µs | BEGIN@12 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 10µs | 814µs | BEGIN@20 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 9µs | 153µs | BEGIN@17 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 9µs | 33µs | BEGIN@24 | JSON::Schema::Modern::Error::
1 | 1 | 1 | 8µs | 40µs | BEGIN@2.67 | JSON::Schema::Modern::
1 | 1 | 1 | 7µs | 386µs | BEGIN@10 | JSON::Schema::Modern::Error::
2 | 2 | 1 | 1µs | 1µs | __ANON__ (xsub) | JSON::Schema::Modern::
0 | 0 | 0 | 0s | 0s | TO_JSON | JSON::Schema::Modern::Error::
0 | 0 | 0 | 0s | 0s | __ANON__[:24] | JSON::Schema::Modern::Error::
0 | 0 | 0 | 0s | 0s | __ANON__[:51] | JSON::Schema::Modern::Error::
0 | 0 | 0 | 0s | 0s | dump | JSON::Schema::Modern::Error::
0 | 0 | 0 | 0s | 0s | stringify | JSON::Schema::Modern::Error::
1 | 1 | 1 | 0s | 0s | SPECIFICATION_VERSION_DEFAULT (xsub) | JSON::Schema::Modern::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 30µs | 2 | 34µs | # spent 31µs (28+3) within JSON::Schema::Modern::BEGIN@1.66 which was called:
# once (28µs+3µs) by JSON::Schema::Modern::BEGIN@33 at line 1 # spent 31µs making 1 call to JSON::Schema::Modern::BEGIN@1.66
# spent 3µs making 1 call to strict::import |
2 | 2 | 54µs | 2 | 72µs | # spent 40µs (8+32) within JSON::Schema::Modern::BEGIN@2.67 which was called:
# once (8µs+32µs) by JSON::Schema::Modern::BEGIN@33 at line 2 # spent 40µs making 1 call to JSON::Schema::Modern::BEGIN@2.67
# spent 32µs making 1 call to warnings::import |
3 | package JSON::Schema::Modern::Error; | ||||
4 | # vim: set ts=8 sts=2 sw=2 tw=100 et : | ||||
5 | # ABSTRACT: Contains a single error from a JSON Schema evaluation | ||||
6 | |||||
7 | 1 | 0s | our $VERSION = '0.558'; | ||
8 | |||||
9 | 2 | 47µs | 1 | 18µs | # spent 18µs within JSON::Schema::Modern::Error::BEGIN@9 which was called:
# once (18µs+0s) by JSON::Schema::Modern::BEGIN@33 at line 9 # spent 18µs making 1 call to JSON::Schema::Modern::Error::BEGIN@9 |
10 | 2 | 46µs | 2 | 765µs | # spent 386µs (7+379) within JSON::Schema::Modern::Error::BEGIN@10 which was called:
# once (7µs+379µs) by JSON::Schema::Modern::BEGIN@33 at line 10 # spent 386µs making 1 call to JSON::Schema::Modern::Error::BEGIN@10
# spent 379µs making 1 call to Moo::import |
11 | 3 | 96µs | 3 | 2.88ms | # spent 1.45ms (29µs+1.42) within JSON::Schema::Modern::Error::BEGIN@11 which was called:
# once (29µs+1.42ms) by JSON::Schema::Modern::BEGIN@33 at line 11 # spent 1.45ms making 1 call to JSON::Schema::Modern::Error::BEGIN@11
# spent 1.38ms making 1 call to strictures::import
# spent 44µs making 1 call to strictures::VERSION |
12 | 2 | 75µs | 2 | 360µs | # spent 186µs (12+174) within JSON::Schema::Modern::Error::BEGIN@12 which was called:
# once (12µs+174µs) by JSON::Schema::Modern::BEGIN@33 at line 12 # spent 186µs making 1 call to JSON::Schema::Modern::Error::BEGIN@12
# spent 174µs making 1 call to experimental::import |
13 | 2 | 48µs | 2 | 67µs | # spent 63µs (22+41) within JSON::Schema::Modern::Error::BEGIN@13 which was called:
# once (22µs+41µs) by JSON::Schema::Modern::BEGIN@33 at line 13 # spent 63µs making 1 call to JSON::Schema::Modern::Error::BEGIN@13
# spent 4µs making 1 call to if::import |
14 | 2 | 44µs | 2 | 45µs | # spent 43µs (17+26) within JSON::Schema::Modern::Error::BEGIN@14 which was called:
# once (17µs+26µs) by JSON::Schema::Modern::BEGIN@33 at line 14 # spent 43µs making 1 call to JSON::Schema::Modern::Error::BEGIN@14
# spent 2µs making 1 call to if::unimport |
15 | 2 | 48µs | 2 | 31µs | # spent 30µs (13+17) within JSON::Schema::Modern::Error::BEGIN@15 which was called:
# once (13µs+17µs) by JSON::Schema::Modern::BEGIN@33 at line 15 # spent 30µs making 1 call to JSON::Schema::Modern::Error::BEGIN@15
# spent 1µs making 1 call to if::unimport |
16 | 2 | 23µs | 2 | 30µs | # spent 30µs (13+17) within JSON::Schema::Modern::Error::BEGIN@16 which was called:
# once (13µs+17µs) by JSON::Schema::Modern::BEGIN@33 at line 16 # spent 30µs making 1 call to JSON::Schema::Modern::Error::BEGIN@16
# spent 0s making 1 call to if::unimport |
17 | 2 | 28µs | 2 | 297µs | # spent 153µs (9+144) within JSON::Schema::Modern::Error::BEGIN@17 which was called:
# once (9µs+144µs) by JSON::Schema::Modern::BEGIN@33 at line 17 # spent 153µs making 1 call to JSON::Schema::Modern::Error::BEGIN@17
# spent 144µs making 1 call to Exporter::import |
18 | 2 | 332µs | 1 | 13.3ms | # spent 13.3ms (9.82+3.48) within JSON::Schema::Modern::Error::BEGIN@18 which was called:
# once (9.82ms+3.48ms) by JSON::Schema::Modern::BEGIN@33 at line 18 # spent 13.3ms making 1 call to JSON::Schema::Modern::Error::BEGIN@18 |
19 | 2 | 40µs | 2 | 1.81ms | # spent 910µs (14+896) within JSON::Schema::Modern::Error::BEGIN@19 which was called:
# once (14µs+896µs) by JSON::Schema::Modern::BEGIN@33 at line 19 # spent 910µs making 1 call to JSON::Schema::Modern::Error::BEGIN@19
# spent 896µs making 1 call to MooX::TypeTiny::import |
20 | 2 | 112µs | 2 | 1.62ms | # spent 814µs (10+804) within JSON::Schema::Modern::Error::BEGIN@20 which was called:
# once (10µs+804µs) by JSON::Schema::Modern::BEGIN@33 at line 20 # spent 814µs making 1 call to JSON::Schema::Modern::Error::BEGIN@20
# spent 804µs making 1 call to Exporter::Tiny::import |
21 | 2 | 686µs | 2 | 14.4ms | # spent 14.1ms (1.60+12.5) within JSON::Schema::Modern::Error::BEGIN@21 which was called:
# once (1.60ms+12.5ms) by JSON::Schema::Modern::BEGIN@33 at line 21 # spent 14.1ms making 1 call to JSON::Schema::Modern::Error::BEGIN@21
# spent 245µs making 1 call to namespace::clean::import |
22 | |||||
23 | use overload | ||||
24 | 2 | 386µs | 2 | 57µs | # spent 33µs (9+24) within JSON::Schema::Modern::Error::BEGIN@24 which was called:
# once (9µs+24µs) by JSON::Schema::Modern::BEGIN@33 at line 24 # spent 33µs making 1 call to JSON::Schema::Modern::Error::BEGIN@24
# spent 24µs making 1 call to overload::import |
25 | |||||
26 | 1 | 4µs | 2 | 24.9ms | has [qw( # spent 24.9ms making 1 call to JSON::Schema::Modern::Error::has
# spent 2µs making 1 call to Types::Standard::Str |
27 | instance_location | ||||
28 | keyword_location | ||||
29 | error | ||||
30 | )] => ( | ||||
31 | is => 'ro', | ||||
32 | isa => Str, | ||||
33 | required => 1, | ||||
34 | ); | ||||
35 | |||||
36 | has absolute_keyword_location => ( | ||||
37 | is => 'ro', | ||||
38 | isa => InstanceOf['Mojo::URL'], | ||||
39 | 4217 | 20.6ms | 4217 | 67.9ms | # spent 90.1ms (22.2+67.9) within JSON::Schema::Modern::Error::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm:39] which was called 4217 times, avg 21µs/call:
# 4217 times (22.2ms+67.9ms) by JSON::Schema::Modern::Error::new at line 68 of (eval 435)[Sub/Quote.pm:3], avg 21µs/call # spent 67.9ms making 4217 calls to Safe::Isa::__ANON__[Safe/Isa.pm:23], avg 16µs/call |
40 | 1 | 9µs | 2 | 4.13ms | ); # spent 3.46ms making 1 call to Types::Standard::InstanceOf
# spent 672µs making 1 call to JSON::Schema::Modern::Error::has |
41 | |||||
42 | 1 | 11µs | 4 | 3.36ms | has keyword => ( # spent 2.68ms making 1 call to Type::Tiny::__ANON__[Type/Tiny.pm:126]
# spent 673µs making 1 call to JSON::Schema::Modern::Error::has
# spent 2µs making 1 call to Types::Standard::Str
# spent 1µs making 1 call to Types::Standard::Undef |
43 | is => 'ro', | ||||
44 | isa => Str|Undef, | ||||
45 | required => 1, | ||||
46 | ); | ||||
47 | |||||
48 | has exception => ( | ||||
49 | is => 'ro', | ||||
50 | isa => InstanceOf['JSON::PP::Boolean'], | ||||
51 | coerce => sub { $_[0] ? JSON::PP::true : JSON::PP::false }, | ||||
52 | 1 | 8µs | 2 | 1.01ms | ); # spent 565µs making 1 call to JSON::Schema::Modern::Error::has
# spent 440µs making 1 call to Types::Standard::InstanceOf |
53 | |||||
54 | 1 | 6µs | 2 | 4.44ms | has mode => ( # spent 3.33ms making 1 call to Types::Standard::Enum
# spent 1.11ms making 1 call to JSON::Schema::Modern::Error::has |
55 | is => 'rw', | ||||
56 | isa => Enum[qw(traverse evaluate)], | ||||
57 | ); | ||||
58 | |||||
59 | sub TO_JSON ($self) { | ||||
60 | return +{ | ||||
61 | # note that locations are JSON pointers, not uri fragments! | ||||
62 | instanceLocation => $self->instance_location, | ||||
63 | keywordLocation => $self->keyword_location, | ||||
64 | !defined($self->absolute_keyword_location) ? () | ||||
65 | : ( absoluteKeywordLocation => $self->absolute_keyword_location->to_string ), | ||||
66 | error => $self->error, # TODO: allow localization | ||||
67 | }; | ||||
68 | } | ||||
69 | |||||
70 | sub stringify ($self) { | ||||
71 | ($self->mode//'evaluate') eq 'traverse' | ||||
72 | ? '\''.$self->keyword_location.'\': '.$self->error | ||||
73 | : '\''.$self->instance_location.'\': '.$self->error; | ||||
74 | } | ||||
75 | |||||
76 | sub dump ($self) { | ||||
77 | my $encoder = JSON::MaybeXS->new(utf8 => 0, convert_blessed => 1, canonical => 1, pretty => 1); | ||||
78 | $encoder->indent_length(2) if $encoder->can('indent_length'); | ||||
79 | $encoder->encode($self); | ||||
80 | } | ||||
81 | |||||
82 | 1 | 17µs | 1; | ||
83 | |||||
84 | 1 | 33µs | 1 | 485µs | __END__ # spent 485µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:26] |
# spent 50µs within JSON::Schema::Modern::CACHED_METASCHEMAS which was called 26 times, avg 2µs/call:
# 18 times (8µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 652 of JSON/Schema/Modern.pm, avg 444ns/call
# 8 times (42µs+0s) by JSON::Schema::Modern::_get_or_load_resource at line 814 of JSON/Schema/Modern.pm, avg 5µs/call | |||||
# spent 388ms within JSON::Schema::Modern::CORE:match which was called 2123434 times, avg 183ns/call:
# 2015087 times (263ms+0s) by JSON::Schema::Modern::_eval_subschema at line 529 of JSON/Schema/Modern.pm, avg 130ns/call
# 87311 times (107ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call
# 21018 times (18.3ms+0s) by JSON::Schema::Modern::_fetch_from_uri at line 855 of JSON/Schema/Modern.pm, avg 870ns/call
# 18 times (7µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 672 of JSON/Schema/Modern.pm, avg 389ns/call | |||||
# spent 124ms within JSON::Schema::Modern::CORE:qr which was called 87311 times, avg 1µs/call:
# 87311 times (124ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call | |||||
# spent 117ms within JSON::Schema::Modern::CORE:regcomp which was called 87311 times, avg 1µs/call:
# 87311 times (117ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call | |||||
# spent 104ms within JSON::Schema::Modern::CORE:sort which was called 128937 times, avg 810ns/call:
# 87311 times (22.2ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 254ns/call
# 39123 times (79.0ms+0s) by JSON::Schema::Modern::_fetch_from_uri at line 865 of JSON/Schema/Modern.pm, avg 2µs/call
# 2488 times (3.25ms+0s) by JSON::Schema::Modern::_traverse_subschema at line 507 of JSON/Schema/Modern.pm, avg 1µs/call
# 15 times (32µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 647 of JSON/Schema/Modern.pm, avg 2µs/call | |||||
# spent 33µs within JSON::Schema::Modern::CORE:subst which was called 126 times, avg 262ns/call:
# 61 times (16µs+0s) by JSON::Schema::Modern::_traverse_subschema at line 475 of JSON/Schema/Modern.pm, avg 262ns/call
# 58 times (12µs+0s) by JSON::Schema::Modern::_eval_subschema at line 563 of JSON/Schema/Modern.pm, avg 207ns/call
# 7 times (5µs+0s) by JSON::Schema::Modern::evaluate at line 365 of JSON/Schema/Modern.pm, avg 714ns/call | |||||
# spent 22µs within JSON::Schema::Modern::METASCHEMA_URIS which was called 15 times, avg 1µs/call:
# 15 times (22µs+0s) by JSON::Schema::Modern::traverse at line 263 of JSON/Schema/Modern.pm, avg 1µs/call | |||||
# spent 0s within JSON::Schema::Modern::SPECIFICATION_VERSION_DEFAULT which was called:
# once (0s+0s) by JSON::Schema::Modern::Document::OpenAPI::traverse at line 76 of JSON/Schema/Modern/Document/OpenAPI.pm | |||||
# spent 1µs within JSON::Schema::Modern::__ANON__ which was called 2 times, avg 500ns/call:
# once (1µs+0s) by JSON::Schema::Modern::BEGIN@34 at line 34 of JSON/Schema/Modern.pm
# once (0s+0s) by JSON::Schema::Modern::BEGIN@33 at line 33 of JSON/Schema/Modern.pm |