stattest.cc (8229:78bf55f23338) stattest.cc (8235:6381dc8bcfcc)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#include <iomanip>
32#include <iostream>
33#include <string>
34
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Nathan Binkert
29 */
30
31#include <iomanip>
32#include <iostream>
33#include <string>
34
35#include "base/stats/mysql.hh"
36#include "base/stats/text.hh"
37#include "base/cprintf.hh"
38#include "base/misc.hh"
39#include "base/statistics.hh"
40#include "base/types.hh"
41#include "sim/core.hh"
42#include "sim/stat_control.hh"
43
35#include "base/cprintf.hh"
36#include "base/misc.hh"
37#include "base/statistics.hh"
38#include "base/types.hh"
39#include "sim/core.hh"
40#include "sim/stat_control.hh"
41
42// override the default main() code for this unittest
43const char *m5MainCommands[] = {
44 "import m5.stattestmain",
45 "m5.stattestmain.main()",
46 0 // sentinel is required
47};
48
44using namespace std;
45using namespace Stats;
46
47double
48testfunc()
49{
50 return 9.8;
51}
52
53class TestClass {
54 public:
55 double operator()() { return 9.7; }
56};
57
49using namespace std;
50using namespace Stats;
51
52double
53testfunc()
54{
55 return 9.8;
56}
57
58class TestClass {
59 public:
60 double operator()() { return 9.7; }
61};
62
58const char *progname = "";
59
60void
61usage()
63struct StatTest
62{
64{
63 panic("incorrect usage.\n"
64 "usage:\n"
65 "\t%s [-t [-c] [-d]]\n", progname);
66}
67
68int
69main(int argc, char *argv[])
70{
71 bool descriptions = false;
72 bool text = false;
73
74#if USE_MYSQL
75 string mysql_name;
76 string mysql_db;
77 string mysql_host;
78 string mysql_user = "binkertn";
79 string mysql_passwd;
80#endif
81
82 char c;
83 progname = argv[0];
84 while ((c = getopt(argc, argv, "cD:dh:P:p:s:tu:")) != -1) {
85 switch (c) {
86 case 'd':
87 descriptions = true;
88 break;
89 case 't':
90 text = true;
91 break;
92#if USE_MYSQL
93 case 'D':
94 mysql_db = optarg;
95 break;
96 case 'h':
97 mysql_host = optarg;
98 break;
99 case 'P':
100 mysql_passwd = optarg;
101 break;
102 case 's':
103 mysql_name = optarg;
104 break;
105 case 'u':
106 mysql_user = optarg;
107 break;
108#endif
109 default:
110 usage();
111 }
112 }
113
114 if (!text && descriptions)
115 usage();
116
117 initSimStats();
118
119 Scalar s1;
120 Scalar s2;
121 Average s3;
122 Scalar s4;
123 Vector s5;
124 Distribution s6;
125 Vector s7;
126 AverageVector s8;
127 StandardDeviation s9;
128 AverageDeviation s10;
129 Scalar s11;
130 Distribution s12;
131 VectorDistribution s13;
132 VectorStandardDeviation s14;
133 VectorAverageDeviation s15;
134 Vector2d s16;
135 Value s17;
136 Value s18;
137 Histogram h01;
138 Histogram h02;
139 Histogram h03;
140 Histogram h04;
141 Histogram h05;
142 Histogram h06;
143 Histogram h07;
144 Histogram h08;
145 Histogram h09;
146 Histogram h10;
147 Histogram h11;
148 Histogram h12;
149
150 Formula f1;
151 Formula f2;
152 Formula f3;
153 Formula f4;
154 Formula f5;
155
65 Scalar s1;
66 Scalar s2;
67 Average s3;
68 Scalar s4;
69 Vector s5;
70 Distribution s6;
71 Vector s7;
72 AverageVector s8;
73 StandardDeviation s9;
74 AverageDeviation s10;
75 Scalar s11;
76 Distribution s12;
77 VectorDistribution s13;
78 VectorStandardDeviation s14;
79 VectorAverageDeviation s15;
80 Vector2d s16;
81 Value s17;
82 Value s18;
83 Histogram h01;
84 Histogram h02;
85 Histogram h03;
86 Histogram h04;
87 Histogram h05;
88 Histogram h06;
89 Histogram h07;
90 Histogram h08;
91 Histogram h09;
92 Histogram h10;
93 Histogram h11;
94 Histogram h12;
95
96 Formula f1;
97 Formula f2;
98 Formula f3;
99 Formula f4;
100 Formula f5;
101
102 void run();
103 void init();
104};
105
106StatTest __stattest;
107void
108stattest_init()
109{
110 __stattest.init();
111}
112
113void
114stattest_run()
115{
116 __stattest.run();
117}
118
119void
120StatTest::init()
121{
156 cprintf("sizeof(Scalar) = %d\n", sizeof(Scalar));
157 cprintf("sizeof(Vector) = %d\n", sizeof(Vector));
158 cprintf("sizeof(Distribution) = %d\n", sizeof(Distribution));
159
160 s1
161 .name("Stat01")
162 .desc("this is statistic 1")
163 ;
164
165 s2
166 .name("Stat02")
167 .desc("this is statistic 2")
168 .prereq(s11)
169 ;
170
171 s3
172 .name("Stat03")
173 .desc("this is statistic 3")
174 .prereq(f5)
175 ;
176
177 s4
178 .name("Stat04")
179 .desc("this is statistic 4")
180 .prereq(s11)
181 ;
182
183 s5
184 .init(5)
185 .name("Stat05")
186 .desc("this is statistic 5")
187 .prereq(s11)
188 .subname(0, "foo1")
189 .subname(1, "foo2")
190 .subname(2, "foo3")
191 .subname(3, "foo4")
192 .subname(4, "foo5")
193 ;
194
195 s6
196 .init(1, 100, 13)
197 .name("Stat06")
198 .desc("this is statistic 6")
199 .prereq(s11)
200 ;
201
202 s7
203 .init(7)
204 .name("Stat07")
205 .desc("this is statistic 7")
206 .precision(1)
207 .flags(pdf | total)
208 .prereq(s11)
209 ;
210
211 s8
212 .init(10)
213 .name("Stat08")
214 .desc("this is statistic 8")
215 .precision(2)
216 .prereq(s11)
217 .subname(4, "blarg")
218 ;
219
220 s9
221 .name("Stat09")
222 .desc("this is statistic 9")
223 .precision(4)
224 .prereq(s11)
225 ;
226
227 s10
228 .name("Stat10")
229 .desc("this is statistic 10")
230 .prereq(s11)
231 ;
232
233 s12
234 .init(1, 100, 13)
235 .name("Stat12")
236 .desc("this is statistic 12")
237 ;
238
239 s13
240 .init(4, 0, 99, 10)
241 .name("Stat13")
242 .desc("this is statistic 13")
243 ;
244
245 s14
246 .init(9)
247 .name("Stat14")
248 .desc("this is statistic 14")
249 ;
250
251 s15
252 .init(10)
253 .name("Stat15")
254 .desc("this is statistic 15")
255 ;
256
257 s16
258 .init(2, 9)
259 .name("Stat16")
260 .desc("this is statistic 16")
261 .flags(total)
262 .subname(0, "sub0")
263 .subname(1, "sub1")
264 .ysubname(0, "y0")
265 .ysubname(1, "y1")
266 ;
267
268 s17
269 .functor(testfunc)
270 .name("Stat17")
271 .desc("this is stat 17")
272 ;
273
274 TestClass testclass;
275 s18
276 .functor(testclass)
277 .name("Stat18")
278 .desc("this is stat 18")
279 ;
280
281 h01
282 .init(11)
283 .name("Histogram01")
284 .desc("this is histogram 1")
285 ;
286
287 h02
288 .init(10)
289 .name("Histogram02")
290 .desc("this is histogram 2")
291 ;
292
293 h03
294 .init(11)
295 .name("Histogram03")
296 .desc("this is histogram 3")
297 ;
298
299 h04
300 .init(10)
301 .name("Histogram04")
302 .desc("this is histogram 4")
303 ;
304
305 h05
306 .init(11)
307 .name("Histogram05")
308 .desc("this is histogram 5")
309 ;
310
311 h06
312 .init(10)
313 .name("Histogram06")
314 .desc("this is histogram 6")
315 ;
316
317 h07
318 .init(11)
319 .name("Histogram07")
320 .desc("this is histogram 7")
321 ;
322
323 h08
324 .init(10)
325 .name("Histogram08")
326 .desc("this is histogram 8")
327 ;
328
329 h09
330 .init(11)
331 .name("Histogram09")
332 .desc("this is histogram 9")
333 ;
334
335 h10
336 .init(10)
337 .name("Histogram10")
338 .desc("this is histogram 10")
339 ;
340
341 h11
342 .init(11)
343 .name("Histogram11")
344 .desc("this is histogram 11")
345 ;
346
347 h12
348 .init(10)
349 .name("Histogram12")
350 .desc("this is histogram 12")
351 ;
352
353 f1
354 .name("Formula1")
355 .desc("this is formula 1")
356 .prereq(s11)
357 ;
358
359 f2
360 .name("Formula2")
361 .desc("this is formula 2")
362 .prereq(s11)
363 .precision(1)
364 ;
365
366 f3
367 .name("Formula3")
368 .desc("this is formula 3")
369 .prereq(s11)
370 .subname(0, "bar1")
371 .subname(1, "bar2")
372 .subname(2, "bar3")
373 .subname(3, "bar4")
374 .subname(4, "bar5")
375 ;
376
377 f4
378 .name("Formula4")
379 .desc("this is formula 4")
380 ;
381
382
383 f1 = s1 + s2;
384 f2 = (-s1) / (-s2) * (-s3 + ULL(100) + s4);
385 f3 = sum(s5) * s7;
386 f4 += constant(10.0);
387 f4 += s5[3];
388 f5 = constant(1);
122 cprintf("sizeof(Scalar) = %d\n", sizeof(Scalar));
123 cprintf("sizeof(Vector) = %d\n", sizeof(Vector));
124 cprintf("sizeof(Distribution) = %d\n", sizeof(Distribution));
125
126 s1
127 .name("Stat01")
128 .desc("this is statistic 1")
129 ;
130
131 s2
132 .name("Stat02")
133 .desc("this is statistic 2")
134 .prereq(s11)
135 ;
136
137 s3
138 .name("Stat03")
139 .desc("this is statistic 3")
140 .prereq(f5)
141 ;
142
143 s4
144 .name("Stat04")
145 .desc("this is statistic 4")
146 .prereq(s11)
147 ;
148
149 s5
150 .init(5)
151 .name("Stat05")
152 .desc("this is statistic 5")
153 .prereq(s11)
154 .subname(0, "foo1")
155 .subname(1, "foo2")
156 .subname(2, "foo3")
157 .subname(3, "foo4")
158 .subname(4, "foo5")
159 ;
160
161 s6
162 .init(1, 100, 13)
163 .name("Stat06")
164 .desc("this is statistic 6")
165 .prereq(s11)
166 ;
167
168 s7
169 .init(7)
170 .name("Stat07")
171 .desc("this is statistic 7")
172 .precision(1)
173 .flags(pdf | total)
174 .prereq(s11)
175 ;
176
177 s8
178 .init(10)
179 .name("Stat08")
180 .desc("this is statistic 8")
181 .precision(2)
182 .prereq(s11)
183 .subname(4, "blarg")
184 ;
185
186 s9
187 .name("Stat09")
188 .desc("this is statistic 9")
189 .precision(4)
190 .prereq(s11)
191 ;
192
193 s10
194 .name("Stat10")
195 .desc("this is statistic 10")
196 .prereq(s11)
197 ;
198
199 s12
200 .init(1, 100, 13)
201 .name("Stat12")
202 .desc("this is statistic 12")
203 ;
204
205 s13
206 .init(4, 0, 99, 10)
207 .name("Stat13")
208 .desc("this is statistic 13")
209 ;
210
211 s14
212 .init(9)
213 .name("Stat14")
214 .desc("this is statistic 14")
215 ;
216
217 s15
218 .init(10)
219 .name("Stat15")
220 .desc("this is statistic 15")
221 ;
222
223 s16
224 .init(2, 9)
225 .name("Stat16")
226 .desc("this is statistic 16")
227 .flags(total)
228 .subname(0, "sub0")
229 .subname(1, "sub1")
230 .ysubname(0, "y0")
231 .ysubname(1, "y1")
232 ;
233
234 s17
235 .functor(testfunc)
236 .name("Stat17")
237 .desc("this is stat 17")
238 ;
239
240 TestClass testclass;
241 s18
242 .functor(testclass)
243 .name("Stat18")
244 .desc("this is stat 18")
245 ;
246
247 h01
248 .init(11)
249 .name("Histogram01")
250 .desc("this is histogram 1")
251 ;
252
253 h02
254 .init(10)
255 .name("Histogram02")
256 .desc("this is histogram 2")
257 ;
258
259 h03
260 .init(11)
261 .name("Histogram03")
262 .desc("this is histogram 3")
263 ;
264
265 h04
266 .init(10)
267 .name("Histogram04")
268 .desc("this is histogram 4")
269 ;
270
271 h05
272 .init(11)
273 .name("Histogram05")
274 .desc("this is histogram 5")
275 ;
276
277 h06
278 .init(10)
279 .name("Histogram06")
280 .desc("this is histogram 6")
281 ;
282
283 h07
284 .init(11)
285 .name("Histogram07")
286 .desc("this is histogram 7")
287 ;
288
289 h08
290 .init(10)
291 .name("Histogram08")
292 .desc("this is histogram 8")
293 ;
294
295 h09
296 .init(11)
297 .name("Histogram09")
298 .desc("this is histogram 9")
299 ;
300
301 h10
302 .init(10)
303 .name("Histogram10")
304 .desc("this is histogram 10")
305 ;
306
307 h11
308 .init(11)
309 .name("Histogram11")
310 .desc("this is histogram 11")
311 ;
312
313 h12
314 .init(10)
315 .name("Histogram12")
316 .desc("this is histogram 12")
317 ;
318
319 f1
320 .name("Formula1")
321 .desc("this is formula 1")
322 .prereq(s11)
323 ;
324
325 f2
326 .name("Formula2")
327 .desc("this is formula 2")
328 .prereq(s11)
329 .precision(1)
330 ;
331
332 f3
333 .name("Formula3")
334 .desc("this is formula 3")
335 .prereq(s11)
336 .subname(0, "bar1")
337 .subname(1, "bar2")
338 .subname(2, "bar3")
339 .subname(3, "bar4")
340 .subname(4, "bar5")
341 ;
342
343 f4
344 .name("Formula4")
345 .desc("this is formula 4")
346 ;
347
348
349 f1 = s1 + s2;
350 f2 = (-s1) / (-s2) * (-s3 + ULL(100) + s4);
351 f3 = sum(s5) * s7;
352 f4 += constant(10.0);
353 f4 += s5[3];
354 f5 = constant(1);
355}
389
356
390 enable();
391 reset();
392
357void
358StatTest::run()
359{
393 s16[1][0] = 1;
394 s16[0][1] = 3;
395 s16[0][0] = 2;
396 s16[1][1] = 9;
397 s16[1][1] += 9;
398 s16[1][8] += 8;
399 s16[1][7] += 7;
400 s16[1][6] += 6;
401 s16[1][5] += 5;
402 s16[1][4] += 4;
403
404 s11 = 1;
405 s3 = 9;
406 s8[3] = 9;
407 s15[0].sample(1234);
408 s15[1].sample(1234);
409 s15[2].sample(1234);
410 s15[3].sample(1234);
411 s15[4].sample(1234);
412 s15[5].sample(1234);
413 s15[6].sample(1234);
414 s15[7].sample(1234);
415 s15[8].sample(1234);
416 s15[9].sample(1234);
417
418 s10.sample(1000000000);
419 curTick(curTick() + ULL(1000000));
420 s10.sample(100000);
421 s10.sample(100000);
422 s10.sample(100000);
423 s10.sample(100000);
424 s10.sample(100000);
425 s10.sample(100000);
426 s10.sample(100000);
427 s10.sample(100000);
428 s10.sample(100000);
429 s10.sample(100000);
430 s10.sample(100000);
431 s10.sample(100000);
432 s10.sample(100000);
433 s13[0].sample(12);
434 s13[1].sample(29);
435 s13[2].sample(12);
436 s13[3].sample(29);
437 s13[0].sample(42);
438 s13[1].sample(29);
439 s13[2].sample(42);
440 s13[3].sample(32);
441 s13[0].sample(52);
442 s13[1].sample(49);
443 s13[2].sample(42);
444 s13[3].sample(25);
445 s13[0].sample(32);
446 s13[1].sample(49);
447 s13[2].sample(22);
448 s13[3].sample(49);
449 s13[0].sample(62);
450 s13[1].sample(99);
451 s13[2].sample(72);
452 s13[3].sample(23);
453 s13[0].sample(52);
454 s13[1].sample(78);
455 s13[2].sample(69);
456 s13[3].sample(49);
457
458 s14[0].sample(1234);
459 s14[1].sample(4134);
460 s14[4].sample(1213);
461 s14[3].sample(1124);
462 s14[2].sample(1243);
463 s14[7].sample(1244);
464 s14[4].sample(7234);
465 s14[2].sample(9234);
466 s14[3].sample(1764);
467 s14[7].sample(1564);
468 s14[3].sample(3234);
469 s14[1].sample(2234);
470 s14[5].sample(1234);
471 s14[2].sample(4334);
472 s14[2].sample(1234);
473 s14[4].sample(4334);
474 s14[6].sample(1234);
475 s14[8].sample(8734);
476 s14[1].sample(5234);
477 s14[3].sample(8234);
478 s14[7].sample(5234);
479 s14[4].sample(4434);
480 s14[3].sample(7234);
481 s14[2].sample(1934);
482 s14[1].sample(9234);
483 s14[5].sample(5634);
484 s14[3].sample(1264);
485 s14[7].sample(5223);
486 s14[0].sample(1234);
487 s14[0].sample(5434);
488 s14[3].sample(8634);
489 s14[1].sample(1234);
490
491
492 s15[0].sample(1234);
493 s15[1].sample(4134);
494 curTick(curTick() + ULL(1000000));
495 s15[4].sample(1213);
496 curTick(curTick() + ULL(1000000));
497 s15[3].sample(1124);
498 curTick(curTick() + ULL(1000000));
499 s15[2].sample(1243);
500 curTick(curTick() + ULL(1000000));
501 s15[7].sample(1244);
502 curTick(curTick() + ULL(1000000));
503 s15[4].sample(7234);
504 s15[2].sample(9234);
505 s15[3].sample(1764);
506 s15[7].sample(1564);
507 s15[3].sample(3234);
508 s15[1].sample(2234);
509 curTick(curTick() + ULL(1000000));
510 s15[5].sample(1234);
511 curTick(curTick() + ULL(1000000));
512 s15[9].sample(4334);
513 curTick(curTick() + ULL(1000000));
514 s15[2].sample(1234);
515 curTick(curTick() + ULL(1000000));
516 s15[4].sample(4334);
517 s15[6].sample(1234);
518 curTick(curTick() + ULL(1000000));
519 s15[8].sample(8734);
520 curTick(curTick() + ULL(1000000));
521 s15[1].sample(5234);
522 curTick(curTick() + ULL(1000000));
523 s15[3].sample(8234);
524 curTick(curTick() + ULL(1000000));
525 s15[7].sample(5234);
526 s15[4].sample(4434);
527 s15[3].sample(7234);
528 s15[2].sample(1934);
529 s15[1].sample(9234);
530 curTick(curTick() + ULL(1000000));
531 s15[5].sample(5634);
532 s15[3].sample(1264);
533 s15[7].sample(5223);
534 s15[0].sample(1234);
535 s15[0].sample(5434);
536 s15[3].sample(8634);
537 curTick(curTick() + ULL(1000000));
538 s15[1].sample(1234);
539
540 s4 = curTick();
541
542 s8[3] = 99999;
543
544 s3 = 12;
545 s3++;
546 curTick(curTick() + 9);
547
548 s1 = 9;
549 s1 += 9;
550 s1 -= 11;
551 s1++;
552 ++s1;
553 s1--;
554 --s1;
555
556 s2 = 9;
557
558 s5[0] += 1;
559 s5[1] += 2;
560 s5[2] += 3;
561 s5[3] += 4;
562 s5[4] += 5;
563
564 s7[0] = 10;
565 s7[1] = 20;
566 s7[2] = 30;
567 s7[3] = 40;
568 s7[4] = 50;
569 s7[5] = 60;
570 s7[6] = 70;
571
572 s6.sample(0);
573 s6.sample(1);
574 s6.sample(2);
575 s6.sample(3);
576 s6.sample(4);
577 s6.sample(5);
578 s6.sample(6);
579 s6.sample(7);
580 s6.sample(8);
581 s6.sample(9);
582
583 s6.sample(10);
584 s6.sample(10);
585 s6.sample(10);
586 s6.sample(10);
587 s6.sample(10);
588 s6.sample(10);
589 s6.sample(10);
590 s6.sample(10);
591 s6.sample(11);
592 s6.sample(19);
593 s6.sample(20);
594 s6.sample(20);
595 s6.sample(21);
596 s6.sample(21);
597 s6.sample(31);
598 s6.sample(98);
599 s6.sample(99);
600 s6.sample(99);
601 s6.sample(99);
602
603 s7[0] = 700;
604 s7[1] = 600;
605 s7[2] = 500;
606 s7[3] = 400;
607 s7[4] = 300;
608 s7[5] = 200;
609 s7[6] = 100;
610
611 s9.sample(100);
612 s9.sample(100);
613 s9.sample(100);
614 s9.sample(100);
615 s9.sample(10);
616 s9.sample(10);
617 s9.sample(10);
618 s9.sample(10);
619 s9.sample(10);
620
621 curTick(curTick() + 9);
622 s4 = curTick();
623 s6.sample(100);
624 s6.sample(100);
625 s6.sample(100);
626 s6.sample(101);
627 s6.sample(102);
628
629 s12.sample(100);
630 for (int i = 0; i < 100; i++) {
631 h01.sample(i);
632 h02.sample(i);
633 }
634
635 for (int i = -100; i < 100; i++) {
636 h03.sample(i);
637 h04.sample(i);
638 }
639
640 for (int i = -100; i < 1000; i++) {
641 h05.sample(i);
642 h06.sample(i);
643 }
644
645 for (int i = 100; i >= -1000; i--) {
646 h07.sample(i);
647 h08.sample(i);
648 }
649
650 for (int i = 0; i <= 1023; i++) {
651 h09.sample(i);
652 h10.sample(i);
653 }
654
655 for (int i = -1024; i <= 1023; i++) {
656 h11.sample(i);
657 h12.sample(i);
658 }
360 s16[1][0] = 1;
361 s16[0][1] = 3;
362 s16[0][0] = 2;
363 s16[1][1] = 9;
364 s16[1][1] += 9;
365 s16[1][8] += 8;
366 s16[1][7] += 7;
367 s16[1][6] += 6;
368 s16[1][5] += 5;
369 s16[1][4] += 4;
370
371 s11 = 1;
372 s3 = 9;
373 s8[3] = 9;
374 s15[0].sample(1234);
375 s15[1].sample(1234);
376 s15[2].sample(1234);
377 s15[3].sample(1234);
378 s15[4].sample(1234);
379 s15[5].sample(1234);
380 s15[6].sample(1234);
381 s15[7].sample(1234);
382 s15[8].sample(1234);
383 s15[9].sample(1234);
384
385 s10.sample(1000000000);
386 curTick(curTick() + ULL(1000000));
387 s10.sample(100000);
388 s10.sample(100000);
389 s10.sample(100000);
390 s10.sample(100000);
391 s10.sample(100000);
392 s10.sample(100000);
393 s10.sample(100000);
394 s10.sample(100000);
395 s10.sample(100000);
396 s10.sample(100000);
397 s10.sample(100000);
398 s10.sample(100000);
399 s10.sample(100000);
400 s13[0].sample(12);
401 s13[1].sample(29);
402 s13[2].sample(12);
403 s13[3].sample(29);
404 s13[0].sample(42);
405 s13[1].sample(29);
406 s13[2].sample(42);
407 s13[3].sample(32);
408 s13[0].sample(52);
409 s13[1].sample(49);
410 s13[2].sample(42);
411 s13[3].sample(25);
412 s13[0].sample(32);
413 s13[1].sample(49);
414 s13[2].sample(22);
415 s13[3].sample(49);
416 s13[0].sample(62);
417 s13[1].sample(99);
418 s13[2].sample(72);
419 s13[3].sample(23);
420 s13[0].sample(52);
421 s13[1].sample(78);
422 s13[2].sample(69);
423 s13[3].sample(49);
424
425 s14[0].sample(1234);
426 s14[1].sample(4134);
427 s14[4].sample(1213);
428 s14[3].sample(1124);
429 s14[2].sample(1243);
430 s14[7].sample(1244);
431 s14[4].sample(7234);
432 s14[2].sample(9234);
433 s14[3].sample(1764);
434 s14[7].sample(1564);
435 s14[3].sample(3234);
436 s14[1].sample(2234);
437 s14[5].sample(1234);
438 s14[2].sample(4334);
439 s14[2].sample(1234);
440 s14[4].sample(4334);
441 s14[6].sample(1234);
442 s14[8].sample(8734);
443 s14[1].sample(5234);
444 s14[3].sample(8234);
445 s14[7].sample(5234);
446 s14[4].sample(4434);
447 s14[3].sample(7234);
448 s14[2].sample(1934);
449 s14[1].sample(9234);
450 s14[5].sample(5634);
451 s14[3].sample(1264);
452 s14[7].sample(5223);
453 s14[0].sample(1234);
454 s14[0].sample(5434);
455 s14[3].sample(8634);
456 s14[1].sample(1234);
457
458
459 s15[0].sample(1234);
460 s15[1].sample(4134);
461 curTick(curTick() + ULL(1000000));
462 s15[4].sample(1213);
463 curTick(curTick() + ULL(1000000));
464 s15[3].sample(1124);
465 curTick(curTick() + ULL(1000000));
466 s15[2].sample(1243);
467 curTick(curTick() + ULL(1000000));
468 s15[7].sample(1244);
469 curTick(curTick() + ULL(1000000));
470 s15[4].sample(7234);
471 s15[2].sample(9234);
472 s15[3].sample(1764);
473 s15[7].sample(1564);
474 s15[3].sample(3234);
475 s15[1].sample(2234);
476 curTick(curTick() + ULL(1000000));
477 s15[5].sample(1234);
478 curTick(curTick() + ULL(1000000));
479 s15[9].sample(4334);
480 curTick(curTick() + ULL(1000000));
481 s15[2].sample(1234);
482 curTick(curTick() + ULL(1000000));
483 s15[4].sample(4334);
484 s15[6].sample(1234);
485 curTick(curTick() + ULL(1000000));
486 s15[8].sample(8734);
487 curTick(curTick() + ULL(1000000));
488 s15[1].sample(5234);
489 curTick(curTick() + ULL(1000000));
490 s15[3].sample(8234);
491 curTick(curTick() + ULL(1000000));
492 s15[7].sample(5234);
493 s15[4].sample(4434);
494 s15[3].sample(7234);
495 s15[2].sample(1934);
496 s15[1].sample(9234);
497 curTick(curTick() + ULL(1000000));
498 s15[5].sample(5634);
499 s15[3].sample(1264);
500 s15[7].sample(5223);
501 s15[0].sample(1234);
502 s15[0].sample(5434);
503 s15[3].sample(8634);
504 curTick(curTick() + ULL(1000000));
505 s15[1].sample(1234);
506
507 s4 = curTick();
508
509 s8[3] = 99999;
510
511 s3 = 12;
512 s3++;
513 curTick(curTick() + 9);
514
515 s1 = 9;
516 s1 += 9;
517 s1 -= 11;
518 s1++;
519 ++s1;
520 s1--;
521 --s1;
522
523 s2 = 9;
524
525 s5[0] += 1;
526 s5[1] += 2;
527 s5[2] += 3;
528 s5[3] += 4;
529 s5[4] += 5;
530
531 s7[0] = 10;
532 s7[1] = 20;
533 s7[2] = 30;
534 s7[3] = 40;
535 s7[4] = 50;
536 s7[5] = 60;
537 s7[6] = 70;
538
539 s6.sample(0);
540 s6.sample(1);
541 s6.sample(2);
542 s6.sample(3);
543 s6.sample(4);
544 s6.sample(5);
545 s6.sample(6);
546 s6.sample(7);
547 s6.sample(8);
548 s6.sample(9);
549
550 s6.sample(10);
551 s6.sample(10);
552 s6.sample(10);
553 s6.sample(10);
554 s6.sample(10);
555 s6.sample(10);
556 s6.sample(10);
557 s6.sample(10);
558 s6.sample(11);
559 s6.sample(19);
560 s6.sample(20);
561 s6.sample(20);
562 s6.sample(21);
563 s6.sample(21);
564 s6.sample(31);
565 s6.sample(98);
566 s6.sample(99);
567 s6.sample(99);
568 s6.sample(99);
569
570 s7[0] = 700;
571 s7[1] = 600;
572 s7[2] = 500;
573 s7[3] = 400;
574 s7[4] = 300;
575 s7[5] = 200;
576 s7[6] = 100;
577
578 s9.sample(100);
579 s9.sample(100);
580 s9.sample(100);
581 s9.sample(100);
582 s9.sample(10);
583 s9.sample(10);
584 s9.sample(10);
585 s9.sample(10);
586 s9.sample(10);
587
588 curTick(curTick() + 9);
589 s4 = curTick();
590 s6.sample(100);
591 s6.sample(100);
592 s6.sample(100);
593 s6.sample(101);
594 s6.sample(102);
595
596 s12.sample(100);
597 for (int i = 0; i < 100; i++) {
598 h01.sample(i);
599 h02.sample(i);
600 }
601
602 for (int i = -100; i < 100; i++) {
603 h03.sample(i);
604 h04.sample(i);
605 }
606
607 for (int i = -100; i < 1000; i++) {
608 h05.sample(i);
609 h06.sample(i);
610 }
611
612 for (int i = 100; i >= -1000; i--) {
613 h07.sample(i);
614 h08.sample(i);
615 }
616
617 for (int i = 0; i <= 1023; i++) {
618 h09.sample(i);
619 h10.sample(i);
620 }
621
622 for (int i = -1024; i <= 1023; i++) {
623 h11.sample(i);
624 h12.sample(i);
625 }
659
660 prepare();
661
662 if (text) {
663 Text out(cout);
664 out.descriptions = descriptions;
665 out();
666 }
667
668#if USE_MYSQL
669 if (!mysql_name.empty()) {
670 MySql out;
671 out.connect(mysql_host, mysql_db, mysql_user, mysql_passwd, "test",
672 mysql_name, "test");
673 out();
674 }
675#endif
676
677 return 0;
678}
626}