|
46 | 46 | FRC = createFRC()
|
47 | 47 | end % of properties (Constant)
|
48 | 48 |
|
| 49 | + properties (Constant, Hidden) |
| 50 | + %Folder for storing the test results in csv format. |
| 51 | + OutputFolder = 'conformanceResults' |
| 52 | + %File for storing the results in csv format. |
| 53 | + OutputFile = fullfile(pwd, CheckPUSCHConformance.OutputFolder, ['conformancePUSCH', char(datetime('now', 'Format', 'yyyyMMdd''T''HHmmss')), '.csv']) |
| 54 | + end % of properties (Constant, Hidden) |
| 55 | + |
49 | 56 | properties (TestParameter)
|
50 | 57 | %PUSCH test configurations.
|
51 | 58 | % Defines, for each test, the DelayProfile, the DelaySpread and the
|
|
54 | 61 | TestConfig = createTestConfig()
|
55 | 62 | end % of properties (TestParameter)
|
56 | 63 |
|
| 64 | + methods (TestClassSetup) |
| 65 | + function preparecsv(obj) |
| 66 | + %Creates a csv file for storing the results of all tests. |
| 67 | + |
| 68 | + if ~exist(obj.OutputFolder, 'dir') |
| 69 | + mkdir(obj.OutputFolder); |
| 70 | + end |
| 71 | + fff = fopen(obj.OutputFile, 'w'); |
| 72 | + |
| 73 | + % Write file header. |
| 74 | + fprintf(fff, '#datatype,measurement,tag,double,dateTime:RFC339\n'); |
| 75 | + fprintf(fff, '#default,,,,\n'); |
| 76 | + fprintf(fff, ',m,config,tp,time\n'); |
| 77 | + |
| 78 | + fclose(fff); |
| 79 | + end % of function preparecsv(obj) |
| 80 | + end % of methods (TestClassSetup) |
| 81 | + |
57 | 82 | methods (Test, TestTags = {'conformance'})
|
58 | 83 | function checkPUSCHconformance(obj, TestConfig)
|
59 | 84 | %Verifies that the target throughput is achieved for the given PUSCH configuration.
|
@@ -128,10 +153,23 @@ function checkPUSCHconformance(obj, TestConfig)
|
128 | 153 | obj.assertGreaterThan(tp, 0.70, 'ERROR: Throughput for a TS case is below the hard acceptance threshold of 70%.');
|
129 | 154 | end
|
130 | 155 |
|
131 |
| - % TODO: export throughput (and possibly other metrics) to grafana. |
| 156 | + % Export throughput in csv format to be imported in grafana. |
| 157 | + writecsv(obj, TestConfig.Name, tp * 100); |
132 | 158 |
|
133 | 159 | end % of function checkPUSCHconformance(obj, TestConfig)
|
134 | 160 | end % of methods (Test, TestTags = {'conformance'})
|
| 161 | + |
| 162 | + methods (Access=private) |
| 163 | + function writecsv(obj, casename, tp) |
| 164 | + %Writes the test entry in the csv file. |
| 165 | + |
| 166 | + fff = fopen(obj.OutputFile, 'a'); |
| 167 | + currTime = char(datetime('now', 'Format', 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z''')); |
| 168 | + fprintf(fff, ',PUSCH Throughput,%s,%.3f,%s\n', casename, tp, currTime); |
| 169 | + |
| 170 | + fclose(fff); |
| 171 | + end % of function writecsv(obj) |
| 172 | + end % of methods (Access=private) |
135 | 173 | end % of classdef CheckConformance < matlab.unittest.TestCase
|
136 | 174 |
|
137 | 175 | function frcdictionary = createFRC()
|
|
0 commit comments