aleph icon indicating copy to clipboard operation
aleph copied to clipboard

Create timestamps per status / enable sample history

Open jseidl opened this issue 11 years ago • 2 comments

Decide a way to track sample history. Timestamps for when sample was collected, queued, processed and stuff.

jseidl avatar Nov 10 '14 19:11 jseidl

Would be greate have a "report" class with: sample.id<PK>, date&time and all runned plugins information. So, in the next time when the same sample will be reanalyzed Aleph creates a new report and append it to the sample information.

Pr0teus avatar Dec 22 '14 17:12 Pr0teus

As all plugins' process method return a Python dict, the method SampleManager.apply_plugins could add a 'datetime' key on the returned dict with datetime.datetime.now(). :-) It's simple and you don't need to change plugin code/structure. You could also add how much time the plugin took to process, for example:

Replace:

                    data = plugin.process()
                    if data and len(data) > 0:
                        sample.add_data(plugin.name, data)

with:

                    start_datetime = datetime.datetime.now()
                    data = plugin.process()
                    end_datetime = datetime.datetime.now()
                    if data and len(data) > 0:
                        data['metadata'] = {'plugin_start_time': start_time,
                                            'plugin_end_time': end_time,
                                            'plugin_name': plugin.name, }
                        sample.add_data(plugin.name, data)

turicas avatar May 30 '15 03:05 turicas