Project

General

Profile

0006-make-statistics-on-evolutions-fixes-14297.patch

Benjamin Dauvergne, 24 Sep 2019 03:28 PM

Download (4.02 KB)

View differences:

Subject: [PATCH 6/7] make statistics on evolutions (fixes #14297)

 tests/olap.model   | 35 +++++++++++++++++++++++++++++++++++
 wcs_olap/feeder.py | 21 +++++++++++++++++++++
 2 files changed, 56 insertions(+)
tests/olap.model
133 133
               "name" : "count",
134 134
               "type" : "integer"
135 135
            },
136
            {
137
               "expression" : "count(evolution.id)",
138
               "join" : [
139
                  "evolution"
140
               ],
141
               "label" : "nombre de demandes ayant changée de statut",
142
               "name" : "count",
143
               "type" : "integer"
144
            },
136 145
            {
137 146
               "expression" : "avg(endpoint_delay)",
138 147
               "label" : "délai de traitement moyen",
......
228 237
               "value" : "status.id",
229 238
               "value_label" : "status.label"
230 239
            },
240
            {
241
               "join" : [
242
                  "evolution",
243
                  "evolution_status"
244
               ],
245
               "label" : "statut dans l'historique",
246
               "name" : "evolution_status",
247
               "type" : "integer",
248
               "value" : "evolution_status.id",
249
               "value_label" : "evolution_status.label"
250
            },
231 251
            {
232 252
               "filter" : false,
233 253
               "join" : [
......
336 356
               "name" : "status",
337 357
               "table" : "status_demande"
338 358
            },
359
            {
360
               "detail" : "id",
361
               "master" : "evolution.status_id",
362
               "name" : "evolution_status",
363
               "table" : "status_demande"
364
            },
339 365
            {
340 366
               "detail" : "id",
341 367
               "master" : "function__receiver",
......
370 396
               "name" : "count",
371 397
               "type" : "integer"
372 398
            },
399
            {
400
               "expression" : "count(evolution.id)",
401
               "join" : [
402
                  "evolution"
403
               ],
404
               "label" : "nombre de demandes ayant changée de statut",
405
               "name" : "count",
406
               "type" : "integer"
407
            },
373 408
            {
374 409
               "expression" : "avg(endpoint_delay)",
375 410
               "label" : "délai de traitement moyen",
wcs_olap/feeder.py
218 218
                    'type': 'integer',
219 219
                    'expression': 'count({fact_table}.id)',
220 220
                },
221
                {
222
                    'name': 'count',
223
                    'label': u'nombre de demandes ayant changée de statut',
224
                    'type': 'integer',
225
                    'expression': 'count(evolution.id)',
226
                    'join': ['evolution'],
227
                },
221 228
                {
222 229
                    'name': 'avg_endpoint_delay',
223 230
                    'label': 'délai de traitement moyen',
......
918 925
            'value': 'status.id',
919 926
            'value_label': 'status.label',
920 927
        })
928
        cube['joins'].append({
929
            'name': 'evolution_status',
930
            'table': self.status_table_name,
931
            'master': 'evolution.status_id',
932
            'detail': 'id',
933
        })
934
        cube['dimensions'].append({
935
            'name': 'evolution_status',
936
            'label': 'statut dans l\'historique',
937
            'join': ['evolution', 'evolution_status'],
938
            'type': 'integer',
939
            'value': 'evolution_status.id',
940
            'value_label': 'evolution_status.label',
941
        })
921 942

  
922 943
        # add dimension for function
923 944
        for function, name in self.formdef.schema.workflow.functions.iteritems():
924
-