line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Autogenerated by Thrift Compiler (0.16.0) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
5
|
|
|
|
|
|
|
# |
6
|
1
|
|
|
1
|
|
438
|
use 5.10.0; |
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
9
|
1
|
|
|
1
|
|
11
|
use Thrift::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
10
|
1
|
|
|
1
|
|
4
|
use Thrift::MessageType; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
11
|
1
|
|
|
1
|
|
5
|
use Thrift::Type; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
14
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
346
|
use Types; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# HELPER FUNCTIONS AND STRUCTURES |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package BenchmarkService_fibonacci_args; |
19
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
418
|
|
20
|
|
|
|
|
|
|
BenchmarkService_fibonacci_args->mk_accessors( qw( n ) ); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
10
|
|
|
10
|
|
12
|
my $classname = shift; |
24
|
10
|
|
|
|
|
14
|
my $self = {}; |
25
|
10
|
|
50
|
|
|
24
|
my $vals = shift || {}; |
26
|
10
|
|
|
|
|
13
|
$self->{n} = undef; |
27
|
10
|
50
|
|
|
|
20
|
if (UNIVERSAL::isa($vals,'HASH')) { |
28
|
10
|
50
|
|
|
|
19
|
if (defined $vals->{n}) { |
29
|
0
|
|
|
|
|
0
|
$self->{n} = $vals->{n}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
10
|
|
|
|
|
16
|
return bless ($self, $classname); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub getName { |
36
|
0
|
|
|
0
|
|
0
|
return 'BenchmarkService_fibonacci_args'; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub read { |
40
|
5
|
|
|
5
|
|
6
|
my ($self, $input) = @_; |
41
|
5
|
|
|
|
|
6
|
my $xfer = 0; |
42
|
5
|
|
|
|
|
5
|
my $fname; |
43
|
5
|
|
|
|
|
5
|
my $ftype = 0; |
44
|
5
|
|
|
|
|
5
|
my $fid = 0; |
45
|
5
|
|
|
|
|
9
|
$xfer += $input->readStructBegin(\$fname); |
46
|
5
|
|
|
|
|
5
|
while (1) |
47
|
|
|
|
|
|
|
{ |
48
|
10
|
|
|
|
|
17
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
49
|
10
|
100
|
|
|
|
15
|
if ($ftype == Thrift::TType::STOP) { |
50
|
5
|
|
|
|
|
15
|
last; |
51
|
|
|
|
|
|
|
} |
52
|
5
|
|
|
|
|
6
|
SWITCH: for($fid) |
53
|
|
|
|
|
|
|
{ |
54
|
5
|
50
|
|
|
|
21
|
/^1$/ && do{ if ($ftype == Thrift::TType::BYTE) { |
|
5
|
50
|
|
|
|
7
|
|
55
|
5
|
|
|
|
|
13
|
$xfer += $input->readByte(\$self->{n}); |
56
|
|
|
|
|
|
|
} else { |
57
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
58
|
|
|
|
|
|
|
} |
59
|
5
|
|
|
|
|
5
|
last; }; |
60
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
61
|
|
|
|
|
|
|
} |
62
|
5
|
|
|
|
|
11
|
$xfer += $input->readFieldEnd(); |
63
|
|
|
|
|
|
|
} |
64
|
5
|
|
|
|
|
12
|
$xfer += $input->readStructEnd(); |
65
|
5
|
|
|
|
|
6
|
return $xfer; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub write { |
69
|
5
|
|
|
5
|
|
6
|
my ($self, $output) = @_; |
70
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
71
|
5
|
|
|
|
|
16
|
$xfer += $output->writeStructBegin('BenchmarkService_fibonacci_args'); |
72
|
5
|
50
|
|
|
|
9
|
if (defined $self->{n}) { |
73
|
5
|
|
|
|
|
9
|
$xfer += $output->writeFieldBegin('n', Thrift::TType::BYTE, 1); |
74
|
5
|
|
|
|
|
11
|
$xfer += $output->writeByte($self->{n}); |
75
|
5
|
|
|
|
|
7
|
$xfer += $output->writeFieldEnd(); |
76
|
|
|
|
|
|
|
} |
77
|
5
|
|
|
|
|
9
|
$xfer += $output->writeFieldStop(); |
78
|
5
|
|
|
|
|
8
|
$xfer += $output->writeStructEnd(); |
79
|
5
|
|
|
|
|
6
|
return $xfer; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package BenchmarkService_fibonacci_result; |
83
|
1
|
|
|
1
|
|
1903
|
use base qw(Class::Accessor); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
415
|
|
84
|
|
|
|
|
|
|
BenchmarkService_fibonacci_result->mk_accessors( qw( success ) ); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub new { |
87
|
10
|
|
|
10
|
|
26
|
my $classname = shift; |
88
|
10
|
|
|
|
|
14
|
my $self = {}; |
89
|
10
|
|
50
|
|
|
25
|
my $vals = shift || {}; |
90
|
10
|
|
|
|
|
16
|
$self->{success} = undef; |
91
|
10
|
50
|
|
|
|
20
|
if (UNIVERSAL::isa($vals,'HASH')) { |
92
|
10
|
50
|
|
|
|
15
|
if (defined $vals->{success}) { |
93
|
0
|
|
|
|
|
0
|
$self->{success} = $vals->{success}; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
} |
96
|
10
|
|
|
|
|
19
|
return bless ($self, $classname); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub getName { |
100
|
0
|
|
|
0
|
|
0
|
return 'BenchmarkService_fibonacci_result'; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub read { |
104
|
5
|
|
|
5
|
|
15
|
my ($self, $input) = @_; |
105
|
5
|
|
|
|
|
5
|
my $xfer = 0; |
106
|
5
|
|
|
|
|
5
|
my $fname; |
107
|
5
|
|
|
|
|
6
|
my $ftype = 0; |
108
|
5
|
|
|
|
|
5
|
my $fid = 0; |
109
|
5
|
|
|
|
|
7
|
$xfer += $input->readStructBegin(\$fname); |
110
|
5
|
|
|
|
|
5
|
while (1) |
111
|
|
|
|
|
|
|
{ |
112
|
10
|
|
|
|
|
18
|
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid); |
113
|
10
|
100
|
|
|
|
15
|
if ($ftype == Thrift::TType::STOP) { |
114
|
5
|
|
|
|
|
5
|
last; |
115
|
|
|
|
|
|
|
} |
116
|
5
|
|
|
|
|
30
|
SWITCH: for($fid) |
117
|
|
|
|
|
|
|
{ |
118
|
5
|
50
|
|
|
|
24
|
/^0$/ && do{ if ($ftype == Thrift::TType::I32) { |
|
5
|
50
|
|
|
|
8
|
|
119
|
5
|
|
|
|
|
22
|
$xfer += $input->readI32(\$self->{success}); |
120
|
|
|
|
|
|
|
} else { |
121
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
122
|
|
|
|
|
|
|
} |
123
|
5
|
|
|
|
|
7
|
last; }; |
124
|
0
|
|
|
|
|
0
|
$xfer += $input->skip($ftype); |
125
|
|
|
|
|
|
|
} |
126
|
5
|
|
|
|
|
8
|
$xfer += $input->readFieldEnd(); |
127
|
|
|
|
|
|
|
} |
128
|
5
|
|
|
|
|
9
|
$xfer += $input->readStructEnd(); |
129
|
5
|
|
|
|
|
7
|
return $xfer; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub write { |
133
|
5
|
|
|
5
|
|
7
|
my ($self, $output) = @_; |
134
|
5
|
|
|
|
|
6
|
my $xfer = 0; |
135
|
5
|
|
|
|
|
8
|
$xfer += $output->writeStructBegin('BenchmarkService_fibonacci_result'); |
136
|
5
|
50
|
|
|
|
14
|
if (defined $self->{success}) { |
137
|
5
|
|
|
|
|
12
|
$xfer += $output->writeFieldBegin('success', Thrift::TType::I32, 0); |
138
|
5
|
|
|
|
|
8
|
$xfer += $output->writeI32($self->{success}); |
139
|
5
|
|
|
|
|
8
|
$xfer += $output->writeFieldEnd(); |
140
|
|
|
|
|
|
|
} |
141
|
5
|
|
|
|
|
8
|
$xfer += $output->writeFieldStop(); |
142
|
5
|
|
|
|
|
9
|
$xfer += $output->writeStructEnd(); |
143
|
5
|
|
|
|
|
5
|
return $xfer; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
package BenchmarkServiceIf; |
147
|
|
|
|
|
|
|
|
148
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub fibonacci{ |
152
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
153
|
0
|
|
|
|
|
0
|
my $n = shift; |
154
|
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
0
|
die 'implement interface'; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
package BenchmarkServiceRest; |
159
|
|
|
|
|
|
|
|
160
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
126
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub new { |
164
|
0
|
|
|
0
|
|
0
|
my ($classname, $impl) = @_; |
165
|
0
|
|
|
|
|
0
|
my $self ={ impl => $impl }; |
166
|
|
|
|
|
|
|
|
167
|
0
|
|
|
|
|
0
|
return bless($self,$classname); |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub fibonacci{ |
171
|
0
|
|
|
0
|
|
0
|
my ($self, $request) = @_; |
172
|
|
|
|
|
|
|
|
173
|
0
|
0
|
|
|
|
0
|
my $n = ($request->{'n'}) ? $request->{'n'} : undef; |
174
|
0
|
|
|
|
|
0
|
return $self->{impl}->fibonacci($n); |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
package BenchmarkServiceClient; |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
1
|
|
|
1
|
|
6
|
use base qw(BenchmarkServiceIf); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
704
|
|
181
|
|
|
|
|
|
|
sub new { |
182
|
1
|
|
|
1
|
|
7
|
my ($classname, $input, $output) = @_; |
183
|
1
|
|
|
|
|
1
|
my $self = {}; |
184
|
1
|
|
|
|
|
2
|
$self->{input} = $input; |
185
|
1
|
50
|
|
|
|
3
|
$self->{output} = defined $output ? $output : $input; |
186
|
1
|
|
|
|
|
2
|
$self->{seqid} = 0; |
187
|
1
|
|
|
|
|
1
|
return bless($self,$classname); |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
sub fibonacci{ |
191
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
192
|
0
|
|
|
|
|
0
|
my $n = shift; |
193
|
|
|
|
|
|
|
|
194
|
0
|
|
|
|
|
0
|
$self->send_fibonacci($n); |
195
|
0
|
|
|
|
|
0
|
return $self->recv_fibonacci(); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub send_fibonacci{ |
199
|
5
|
|
|
5
|
|
21
|
my $self = shift; |
200
|
5
|
|
|
|
|
6
|
my $n = shift; |
201
|
|
|
|
|
|
|
|
202
|
5
|
|
|
|
|
15
|
$self->{output}->writeMessageBegin('fibonacci', Thrift::TMessageType::CALL, $self->{seqid}); |
203
|
5
|
|
|
|
|
13
|
my $args = BenchmarkService_fibonacci_args->new(); |
204
|
5
|
|
|
|
|
8
|
$args->{n} = $n; |
205
|
5
|
|
|
|
|
12
|
$args->write($self->{output}); |
206
|
5
|
|
|
|
|
11
|
$self->{output}->writeMessageEnd(); |
207
|
5
|
|
|
|
|
9
|
$self->{output}->getTransport()->flush(); |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub recv_fibonacci{ |
211
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
212
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
0
|
my $rseqid = 0; |
214
|
0
|
|
|
|
|
0
|
my $fname; |
215
|
0
|
|
|
|
|
0
|
my $mtype = 0; |
216
|
|
|
|
|
|
|
|
217
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageBegin(\$fname, \$mtype, \$rseqid); |
218
|
0
|
0
|
|
|
|
0
|
if ($mtype == Thrift::TMessageType::EXCEPTION) { |
219
|
0
|
|
|
|
|
0
|
my $x = Thrift::TApplicationException->new(); |
220
|
0
|
|
|
|
|
0
|
$x->read($self->{input}); |
221
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
222
|
0
|
|
|
|
|
0
|
die $x; |
223
|
|
|
|
|
|
|
} |
224
|
0
|
|
|
|
|
0
|
my $result = BenchmarkService_fibonacci_result->new(); |
225
|
0
|
|
|
|
|
0
|
$result->read($self->{input}); |
226
|
0
|
|
|
|
|
0
|
$self->{input}->readMessageEnd(); |
227
|
|
|
|
|
|
|
|
228
|
0
|
0
|
|
|
|
0
|
if (defined $result->{success} ) { |
229
|
0
|
|
|
|
|
0
|
return $result->{success}; |
230
|
|
|
|
|
|
|
} |
231
|
0
|
|
|
|
|
0
|
die "fibonacci failed: unknown result"; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
package BenchmarkServiceProcessor; |
234
|
|
|
|
|
|
|
|
235
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
289
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
sub new { |
239
|
1
|
|
|
1
|
|
24
|
my ($classname, $handler) = @_; |
240
|
1
|
|
|
|
|
4
|
my $self = {}; |
241
|
1
|
|
|
|
|
2
|
$self->{handler} = $handler; |
242
|
1
|
|
|
|
|
3
|
return bless ($self, $classname); |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
sub process { |
246
|
5
|
|
|
5
|
|
7
|
my ($self, $input, $output) = @_; |
247
|
5
|
|
|
|
|
6
|
my $rseqid = 0; |
248
|
5
|
|
|
|
|
5
|
my $fname = undef; |
249
|
5
|
|
|
|
|
4
|
my $mtype = 0; |
250
|
|
|
|
|
|
|
|
251
|
5
|
|
|
|
|
11
|
$input->readMessageBegin(\$fname, \$mtype, \$rseqid); |
252
|
5
|
|
|
|
|
7
|
my $methodname = 'process_'.$fname; |
253
|
5
|
50
|
|
|
|
27
|
if (!$self->can($methodname)) { |
254
|
0
|
|
|
|
|
0
|
$input->skip(Thrift::TType::STRUCT); |
255
|
0
|
|
|
|
|
0
|
$input->readMessageEnd(); |
256
|
0
|
|
|
|
|
0
|
my $x = Thrift::TApplicationException->new('Function '.$fname.' not implemented.', Thrift::TApplicationException::UNKNOWN_METHOD); |
257
|
0
|
|
|
|
|
0
|
$output->writeMessageBegin($fname, Thrift::TMessageType::EXCEPTION, $rseqid); |
258
|
0
|
|
|
|
|
0
|
$x->write($output); |
259
|
0
|
|
|
|
|
0
|
$output->writeMessageEnd(); |
260
|
0
|
|
|
|
|
0
|
$output->getTransport()->flush(); |
261
|
0
|
|
|
|
|
0
|
return; |
262
|
|
|
|
|
|
|
} |
263
|
5
|
|
|
|
|
18
|
$self->$methodname($rseqid, $input, $output); |
264
|
5
|
|
|
|
|
11
|
return 1; |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
sub process_fibonacci { |
268
|
5
|
|
|
5
|
|
7
|
my ($self, $seqid, $input, $output) = @_; |
269
|
5
|
|
|
|
|
8
|
my $args = BenchmarkService_fibonacci_args->new(); |
270
|
5
|
|
|
|
|
9
|
$args->read($input); |
271
|
5
|
|
|
|
|
9
|
$input->readMessageEnd(); |
272
|
5
|
|
|
|
|
9
|
my $result = BenchmarkService_fibonacci_result->new(); |
273
|
5
|
|
|
|
|
13
|
$result->{success} = $self->{handler}->fibonacci($args->n); |
274
|
5
|
|
|
|
|
150
|
$output->writeMessageBegin('fibonacci', Thrift::TMessageType::REPLY, $seqid); |
275
|
5
|
|
|
|
|
12
|
$result->write($output); |
276
|
5
|
|
|
|
|
9
|
$output->writeMessageEnd(); |
277
|
5
|
|
|
|
|
9
|
$output->getTransport()->flush(); |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
1; |