•  
      request #8696 Improve site statistics generation time
    Infos
    #8696
    Sandra Echinard (sechinard)
    2016-01-15 17:01
    2015-12-11 11:06
    8817
    Details
    Improve site statistics generation time
    Empty
    Other
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2016-01-05
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Thomas Gerbet (tgerbet)2016-01-15 17:01
    Work around site statistics generation time integrated into Tuleap 8.10.99.12.
    User avatar
    last edited by: Sandra Echinard (sechinard) 2016-01-06 13:34
    Integrated in 8.10
    https://gerrit.tuleap.net/#/c/4881/
    Details:
    Optimize transformation of statistics export to CSV


    Also add indexes to speed up MySQL queries.

    Given the following code snippet:
    $data_line = array('Data1,', 'Data 2', 'Data 3', 'Data 4', 'Data5');
    $statistics_formatter = new Statistics_Formatter('', '', ',');
    for($i = 0; $i < 20000; $i++) {
    $statistics_formatter->addHeader('Title');
    $statistics_formatter->addLine($data_line);
    $statistics_formatter->addEmptyLine();
    $statistics_formatter->addLine($data_line);
    }
    $statistics_formatter->getCsvContent();

    I get these results on my dev instances:
    Before optimization: 6.04s
    After optimization: 250ms
    Both implementation have a similar memory cost.