Create timestamps per status / enable sample history
Decide a way to track sample history. Timestamps for when sample was collected, queued, processed and stuff.
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.
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)