comparison m-toolbox/test/aorepo_proto_test/repo_test_obj_number.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 % REPO_TEST_OBJ_NUMBER Test repository submission/retrieval of different
2 % number of AOs of the same size
3 %
4 % M HUeller 05-12-08
5 %
6 % $Id: repo_test_obj_number.m,v 1.7 2009/03/02 16:28:19 mauro Exp $
7 %
8 function results = repo_test_obj_number()
9
10 %% Prepares the plist for AOs
11 NSECS = 3.6e3;
12
13 % nobjs = [linspace(1,10,10) linspace(20,100,9) linspace(200,1000,9)]';
14 nobjs = [linspace(1,10,10) linspace(20,60,3)]';
15
16 NOBJS_STEPS = length(nobjs);
17
18 n_freqs = 10;
19 fs = 10;
20 f_m = linspace(0.001, 0.01, n_freqs);
21 A = linspace(0.1, 1, n_freqs);
22 phi = linspace(0, pi, n_freqs);
23
24 pl_ao = plist('waveform', 'sine wave', ...
25 'fs', fs, ...
26 'f', f_m, ...
27 'A', A, ...
28 'phi', phi, ...
29 'nsecs', NSECS);
30
31
32
33 %% Prepares a plist with the needed parameters
34 pl_run = plist('RAND_N_OBJ', false, ...
35 'N_OBJ', [], ...
36 'OBJ_TYPE', 'ao', ...
37 'RAND_AO', false, ...
38 'AO_PARAMS', pl_ao, ...
39 'HOSTNAME', 'btlab.science.unitn.it', ...
40 'DBASE', 'ltpda_test', ...
41 'SAVE_OBJS', false, ...
42 'SUBMIT', true, ...
43 'CONN', [], ...
44 'SAVE_RESULTS', false, ...
45 'DIR', [], ...
46 'RESULTS_FILENAME','repo_test' ...
47 );
48
49 % Empty arrays for the results
50 results = cell(NOBJS_STEPS, 1);
51 ret_time_xml = zeros(NOBJS_STEPS, 1);
52 ret_time_bin = zeros(NOBJS_STEPS, 1);
53 sub_time = zeros(NOBJS_STEPS, 1);
54
55 %% Runs the tests with AOs
56
57 for kk = 1 : NOBJS_STEPS
58 results{kk} = repo_test_func(pl_run.pset('N_OBJ', nobjs(kk)));
59 end
60
61 %% Puts together a report
62 import utils.const.*
63 utils.helper.msg(msg.MNAME, '%s\n%s\n%s\n%s\n%s\n%s\n%s', ...
64 ' ','%%%%%%%%%%%%%',' ',...
65 ['Test started at: ' datestr(find(results{1}, 'start_time')) ...
66 ' and ended at: ' datestr(find(results{end}, 'stop_time'))], ...
67 ' ','%%%%%%%%%%%%%',' ');
68
69 % TODO: add more info here (which repo etc)
70
71 % Collects the results into a matrix
72 for kk = 1 : NOBJS_STEPS
73 ret_time_xml(kk) = find(results{kk}, 'ret_time_xml');
74 ret_time_bin(kk) = find(results{kk}, 'ret_time_bin');
75 sub_time(kk) = find(results{kk}, 'sub_time');
76 end
77
78 % Plot submit times for objects as a function of number of objects
79 fig_sub_time = figure;
80 plot(nobjs, sub_time, 'b.');
81 hold on;
82 grid on;
83
84 xlabel('Number of objs []');
85 ylabel('Submit time [s]');
86 title(['AO, fs = ' num2str(fs) ' nsecs = ' num2str(NSECS) ' s']);
87 legend('XML + Binary submission');
88
89
90 % Plot retrieval times for objects as a function of object size
91 fig_ret_time = figure;
92 plot(nobjs, ret_time_xml, 'b.');
93 hold on;
94 plot(nobjs, ret_time_bin, 'r.');
95 grid on;
96
97 xlabel('Number of objs []');
98 ylabel('Retrieval time [s]');
99 title(['AO, fs = ' num2str(fs) ' nsecs = ' num2str(NSECS) ' s']);
100 legend('XML retrieval','Binary retrieval');
101
102
103 end
104 % END