Project

General

Profile

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

Benjamin Dauvergne, 18 Jan 2019 11:09 PM

Download (4.02 KB)

View differences:

Subject: [PATCH 5/5] 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" : [
......
318 338
               "name" : "status",
319 339
               "table" : "status_demande"
320 340
            },
341
            {
342
               "detail" : "id",
343
               "master" : "evolution.status_id",
344
               "name" : "evolution_status",
345
               "table" : "status_demande"
346
            },
321 347
            {
322 348
               "detail" : "id",
323 349
               "master" : "function__receiver",
......
346 372
               "name" : "count",
347 373
               "type" : "integer"
348 374
            },
375
            {
376
               "expression" : "count(evolution.id)",
377
               "join" : [
378
                  "evolution"
379
               ],
380
               "label" : "nombre de demandes ayant changée de statut",
381
               "name" : "count",
382
               "type" : "integer"
383
            },
349 384
            {
350 385
               "expression" : "avg(endpoint_delay)",
351 386
               "label" : "délai de traitement moyen",
wcs_olap/feeder.py
200 200
                    'type': 'integer',
201 201
                    'expression': 'count({fact_table}.id)',
202 202
                },
203
                {
204
                    'name': 'count',
205
                    'label': u'nombre de demandes ayant changée de statut',
206
                    'type': 'integer',
207
                    'expression': 'count(evolution.id)',
208
                    'join': ['evolution'],
209
                },
203 210
                {
204 211
                    'name': 'avg_endpoint_delay',
205 212
                    'label': 'délai de traitement moyen',
......
841 848
            'value': 'status.id',
842 849
            'value_label': 'status.label',
843 850
        })
851
        cube['joins'].append({
852
            'name': 'evolution_status',
853
            'table': self.status_table_name,
854
            'master': 'evolution.status_id',
855
            'detail': 'id',
856
        })
857
        cube['dimensions'].append({
858
            'name': 'evolution_status',
859
            'label': 'statut dans l\'historique',
860
            'join': ['evolution', 'evolution_status'],
861
            'type': 'integer',
862
            'value': 'evolution_status.id',
863
            'value_label': 'evolution_status.label',
864
        })
844 865

  
845 866
        # add dimension for function
846 867
        for function, name in self.formdef.schema.workflow.functions.iteritems():
847
-