Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Create timestamps per status / enable sample history #15

Open
jseidl opened this issue Nov 10, 2014 · 2 comments
Open

Create timestamps per status / enable sample history #15

jseidl opened this issue Nov 10, 2014 · 2 comments
Labels

Comments

@jseidl
Copy link
Contributor

jseidl commented Nov 10, 2014

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

@Pr0teus
Copy link
Contributor

Pr0teus commented Dec 22, 2014

Would be greate have a "report" class with: sample.id, 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.

@turicas
Copy link
Contributor

turicas commented May 30, 2015

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants