Filename | /usr/local/lib/perl/5.14.2/MongoDB/Connection.pm |
Statements | Executed 124 statements in 950µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.28ms | 75.6ms | BEGIN@28 | MongoDB::Connection::
1 | 1 | 1 | 1.83ms | 305ms | BEGIN@24 | MongoDB::Connection::
1 | 1 | 1 | 1.17ms | 54.4ms | BEGIN@27 | MongoDB::Connection::
1 | 1 | 1 | 11µs | 11µs | BEGIN@30 | MongoDB::Connection::
1 | 1 | 1 | 10µs | 10µs | BEGIN@26 | MongoDB::Connection::
1 | 1 | 1 | 9µs | 42µs | BEGIN@34 | MongoDB::Connection::
1 | 1 | 1 | 7µs | 23µs | BEGIN@31 | MongoDB::Connection::
1 | 1 | 1 | 6µs | 30µs | BEGIN@33 | MongoDB::Connection::
1 | 1 | 1 | 6µs | 6µs | BEGIN@32 | MongoDB::Connection::
0 | 0 | 0 | 0s | 0s | AUTOLOAD | MongoDB::Connection::
0 | 0 | 0 | 0s | 0s | __ANON__[:49] | MongoDB::Connection::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # | ||||
2 | # Copyright 2009-2013 MongoDB, Inc. | ||||
3 | # | ||||
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
5 | # you may not use this file except in compliance with the License. | ||||
6 | # You may obtain a copy of the License at | ||||
7 | # | ||||
8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||
9 | # | ||||
10 | # Unless required by applicable law or agreed to in writing, software | ||||
11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
13 | # See the License for the specific language governing permissions and | ||||
14 | # limitations under the License. | ||||
15 | # | ||||
16 | |||||
17 | package MongoDB::Connection; | ||||
18 | { | ||||
19 | 2 | 1µs | $MongoDB::Connection::VERSION = '0.702.2'; | ||
20 | } | ||||
21 | |||||
22 | # ABSTRACT: A connection to a MongoDB server (DEPRECATED) | ||||
23 | |||||
24 | 2 | 92µs | 2 | 310ms | # spent 305ms (1.83+303) within MongoDB::Connection::BEGIN@24 which was called:
# once (1.83ms+303ms) by MongoDB::BEGIN@28 at line 24 # spent 305ms making 1 call to MongoDB::Connection::BEGIN@24
# spent 5.06ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:519] |
25 | |||||
26 | 2 | 26µs | 1 | 10µs | # spent 10µs within MongoDB::Connection::BEGIN@26 which was called:
# once (10µs+0s) by MongoDB::BEGIN@28 at line 26 # spent 10µs making 1 call to MongoDB::Connection::BEGIN@26 |
27 | 2 | 128µs | 1 | 54.4ms | # spent 54.4ms (1.17+53.3) within MongoDB::Connection::BEGIN@27 which was called:
# once (1.17ms+53.3ms) by MongoDB::BEGIN@28 at line 27 # spent 54.4ms making 1 call to MongoDB::Connection::BEGIN@27 |
28 | 2 | 151µs | 1 | 75.6ms | # spent 75.6ms (2.28+73.3) within MongoDB::Connection::BEGIN@28 which was called:
# once (2.28ms+73.3ms) by MongoDB::BEGIN@28 at line 28 # spent 75.6ms making 1 call to MongoDB::Connection::BEGIN@28 |
29 | |||||
30 | 2 | 28µs | 1 | 11µs | # spent 11µs within MongoDB::Connection::BEGIN@30 which was called:
# once (11µs+0s) by MongoDB::BEGIN@28 at line 30 # spent 11µs making 1 call to MongoDB::Connection::BEGIN@30 |
31 | 2 | 23µs | 2 | 40µs | # spent 23µs (7+16) within MongoDB::Connection::BEGIN@31 which was called:
# once (7µs+16µs) by MongoDB::BEGIN@28 at line 31 # spent 23µs making 1 call to MongoDB::Connection::BEGIN@31
# spent 16µs making 1 call to Exporter::import |
32 | 2 | 20µs | 1 | 6µs | # spent 6µs within MongoDB::Connection::BEGIN@32 which was called:
# once (6µs+0s) by MongoDB::BEGIN@28 at line 32 # spent 6µs making 1 call to MongoDB::Connection::BEGIN@32 |
33 | 2 | 21µs | 2 | 54µs | # spent 30µs (6+24) within MongoDB::Connection::BEGIN@33 which was called:
# once (6µs+24µs) by MongoDB::BEGIN@28 at line 33 # spent 30µs making 1 call to MongoDB::Connection::BEGIN@33
# spent 24µs making 1 call to Exporter::import |
34 | 2 | 226µs | 2 | 47µs | # spent 42µs (9+33) within MongoDB::Connection::BEGIN@34 which was called:
# once (9µs+33µs) by MongoDB::BEGIN@28 at line 34 # spent 42µs making 1 call to MongoDB::Connection::BEGIN@34
# spent 5µs making 1 call to boolean::import |
35 | |||||
36 | |||||
37 | 49 | 80µs | 49 | 24µs | has '_client' => ( # spent 24µs making 49 calls to MongoDB::Connection::CORE:match, avg 496ns/call |
38 | isa => 'MongoDB::MongoClient', | ||||
39 | is => 'ro', | ||||
40 | 49 | 91µs | 49 | 20µs | handles => [ grep { $_ !~ /^(meta|new)$/ } # spent 20µs making 49 calls to Class::MOP::Method::name, avg 418ns/call |
41 | 1 | 32µs | 3 | 12.0ms | map { $_->name } Class::MOP::Class->initialize( 'MongoDB::MongoClient' )->get_all_methods # spent 8.20ms making 1 call to Moose::has
# spent 3.84ms making 1 call to Class::MOP::Class::Immutable::Moose::Meta::Class::get_all_methods
# spent 9µs making 1 call to Class::MOP::Class::initialize |
42 | ] | ||||
43 | ); | ||||
44 | |||||
45 | |||||
46 | around 'new' => sub { | ||||
47 | 2 | 12µs | my ( $orig, $self, @args ) = @_; | ||
48 | 2 | 9.53ms | return $self->$orig( _client => MongoDB::MongoClient->new( @args ) ); # spent 9.18ms making 1 call to MongoDB::MongoClient::new
# spent 350µs making 1 call to Moose::Object::new | ||
49 | 1 | 4µs | 1 | 266µs | }; # spent 266µs making 1 call to Moose::around |
50 | |||||
- - | |||||
53 | sub AUTOLOAD { | ||||
54 | my $self = shift @_; | ||||
55 | our $AUTOLOAD; | ||||
56 | |||||
57 | my $db = $AUTOLOAD; | ||||
58 | $db =~ s/.*:://; | ||||
59 | |||||
60 | carp sprintf q{AUTOLOADed database method names are deprecated and will be removed in a future release. Use $client->get_database( '%s' ) instead.}, $db; | ||||
61 | |||||
62 | return $self->get_database($db); | ||||
63 | } | ||||
64 | |||||
- - | |||||
67 | 1 | 3µs | 2 | 135µs | __PACKAGE__->meta->make_immutable ( inline_destructor => 0, inline_constructor => 0 ); # spent 118µs making 1 call to Class::MOP::Class::make_immutable
# spent 17µs making 1 call to MongoDB::Connection::meta |
68 | |||||
69 | 1 | 12µs | 1; | ||
70 | |||||
71 | __END__ |