Mercurial > hg > ltpda
comparison m-toolbox/test/aorepo_proto_test/test2.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function test2() | |
2 | |
3 % Tests the submit and retrieve time Vs the size of AOs in the database. | |
4 % | |
5 % M Hewitson 25-07-07 | |
6 % | |
7 % $Id: test2.m,v 1.4 2008/03/01 14:53:31 hewitson Exp $ | |
8 % | |
9 | |
10 | |
11 | |
12 [conn, username] = mysql_connect('130.75.117.63', 'ltpda_test'); | |
13 | |
14 % Make an AO | |
15 | |
16 % Run over N submit and retrieves | |
17 Tmax = 40*3600; | |
18 S = []; | |
19 R = []; | |
20 T = []; | |
21 | |
22 k = 1; | |
23 N = 1; | |
24 n = []; | |
25 while N <= Tmax | |
26 | |
27 n(k) = N; | |
28 nsecs = N; | |
29 fs = 10; | |
30 | |
31 pl = plist(); | |
32 pl = append(pl, param('nsecs', nsecs)); | |
33 pl = append(pl, param('fs', fs)); | |
34 pl = append(pl, param('tsfcn', 'randn(size(t))')); | |
35 a1 = ao(pl); | |
36 | |
37 disp(' ') | |
38 disp(sprintf('*===== Test %d (%d secs) =========', k, N)) | |
39 disp(' ') | |
40 | |
41 [stime, rtime, status] = submitretrieve(conn, username, a1, k); | |
42 | |
43 S(k) = stime; | |
44 R(k) = rtime; | |
45 T(k) = status; | |
46 | |
47 results.S = S; | |
48 results.R = R; | |
49 results.T = T; | |
50 results.N = n; | |
51 | |
52 save 'test2_results_64bit.mat' results | |
53 | |
54 k = k + 1; | |
55 N = round(N * 1.2); | |
56 end | |
57 | |
58 | |
59 | |
60 | |
61 %------------------------------------ | |
62 function [st, rt, status] = submitretrieve(conn, username, a, N) | |
63 | |
64 sinfo.conn = conn; | |
65 sinfo.username = username; | |
66 sinfo.experiment_title = 'Repository Test 2'; | |
67 sinfo.experiment_description = sprintf('Submit/retrieve of AO # %d', N); | |
68 sinfo.reference_ids = ''; | |
69 sinfo.additional_comments = ''; | |
70 sinfo.additional_authors = ''; | |
71 | |
72 % submit the ao | |
73 tic | |
74 [AOids, cid] = ltpda_obj_submit(a, sinfo); | |
75 st = toc; | |
76 | |
77 % retrieve the ao | |
78 tic | |
79 b = ltpda_obj_retrieve(conn, cid); | |
80 rt = toc; | |
81 | |
82 % check consistency | |
83 if a ~= b | |
84 status = 0; | |
85 else | |
86 status = 1; | |
87 end | |
88 | |
89 | |
90 % END |