← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/bin/epoll_server.pl
  Run on Wed Jan 5 05:34:33 2011
Reported on Wed Jan 5 05:38:47 2011

File /usr/lib/perl5/vendor_perl/5.10.1/Epoll/DB/Poll/BSubmit.pm
Statements Executed 10
Statement Execution Time 1.22ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11152µs77µsEpoll::DB::Poll::BSubmit::::BEGIN@5Epoll::DB::Poll::BSubmit::BEGIN@5
11133µs90µsEpoll::DB::Poll::BSubmit::::BEGIN@6Epoll::DB::Poll::BSubmit::BEGIN@6
11131µs731µsEpoll::DB::Poll::BSubmit::::BEGIN@7Epoll::DB::Poll::BSubmit::BEGIN@7
0000s0sEpoll::DB::Poll::BSubmit::::add_itemEpoll::DB::Poll::BSubmit::add_item
0000s0sEpoll::DB::Poll::BSubmit::::set_voterEpoll::DB::Poll::BSubmit::set_voter
0000s0sEpoll::DB::Poll::BSubmit::::submitEpoll::DB::Poll::BSubmit::submit
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Epoll::DB::Poll::BSubmit;
2
3# $Id: BSubmit.pm 319 2010-06-01 08:48:29Z nanardon $
4
53100µs2102µs
# spent 77µs (52+25) within Epoll::DB::Poll::BSubmit::BEGIN@5 which was called # once (52µs+25µs) by Epoll::DB::Poll::BEGIN@16 at line 5
use strict;
# spent 77µs making 1 call to Epoll::DB::Poll::BSubmit::BEGIN@5 # spent 25µs making 1 call to strict::import
6385µs2146µs
# spent 90µs (33+57) within Epoll::DB::Poll::BSubmit::BEGIN@6 which was called # once (33µs+57µs) by Epoll::DB::Poll::BEGIN@16 at line 6
use warnings;
# spent 90µs making 1 call to Epoll::DB::Poll::BSubmit::BEGIN@6 # spent 57µs making 1 call to warnings::import
731.03ms21.43ms
# spent 731µs (31+700) within Epoll::DB::Poll::BSubmit::BEGIN@7 which was called # once (31µs+700µs) by Epoll::DB::Poll::BEGIN@16 at line 7
use base 'Epoll::DB::Poll::Bdata';
# spent 731µs making 1 call to Epoll::DB::Poll::BSubmit::BEGIN@7 # spent 700µs making 1 call to base::import
8
9=head1 NAME
10
11Epoll::Model::Vote - Catalyst Model
12
13=head1 DESCRIPTION
14
15Catalyst Model.
16
17=cut
18
19sub set_voter {
20 my ($self, $voter, $referal) = @_;
21 $self->{voter} = $voter;
22 $self->{referal} = $referal;
23}
24
25sub add_item {
26 my ($self, $value, $weight) = @_;
27 $value =~ s/^\s+//;
28 $value =~ s/\s+$//;
29 $value =~ s/\s+/ /g;
30 $value = lc($value);
31 $self->{data}{content}{$value} = $weight;
32}
33
34sub submit {
35 my ($self) = @_;
36
37 for (0..2) { # 3 try
38 # First we register voting has voted
39 $self->poll->_register_signing($self->{voter}, $self->{referal}) or return; # TODO error ?
40
41 # registring choices
42 if ($self->_store_crypted()) {
43 last;
44 } else {
45 $self->rollback;
46 next;
47 }
48
49 }
50 # everything went fine, saving!
51 $self->commit;
52
53 $self->uid
54}
55
56
57=head1 AUTHOR
58
59Thauvin Olivier
60
61=head1 LICENSE
62
63This library is free software, you can redistribute it and/or modify
64it under the same terms as Perl itself or CeCILL.
65
66=cut
67
6818µs1;