Processing Data and Gathering Statistics - Design Question RRS feed

  • Question

  • User-1647864282 posted

    Just wanted to get some feed back to see if this has already been addressed before.

    I am working on an app which does "a lot" of data processing. I need to gather some statistics on how much data has been processed. My main objective is to make the statistic gathering logic as unintrusive as possible. For example:

    foreach(var items in myDataCollection)
    //Gather Statistics
    Process more stuff();
    //Gather Other type of Statistics

    I am not sure if injecting my "Statistic Gathering Logic" within the processing logic a good thing or not. I guess my question is should I just inject the "Statistic Gathering Logic" within the process i.e. make another call to method which basically just stores the information in a table, or should I raise an event or perhaps something else?

    Are there any Patterns out there which address this already so I don't have to reinvent the wheel?

    Tuesday, January 19, 2010 2:58 PM


All replies