apavlenko / vmf

http://01org.github.io/vmf/
Apache License 2.0
0 stars 3 forks source link

Statistics object #4

Closed apavlenko closed 8 years ago

apavlenko commented 8 years ago

Feature name: Statistics object

Requirements:

Note: while any statistic can be easily updated on data addition, some statistics (e.g. MAX or MIN) may require full data re-scan to update on data remove or edit; so the decision is to switch the statistics object to manual (by request) update mode and make full re-scan on explicit request only!

Note: the feature includes API, implementation, tests, samples, doc update

apavlenko commented 8 years ago

Use case 1:

user defines new VMF schema and configures required statistics (e.g. min/max/average age) and its manual update; user adds new metadata records to the schema data stream (in particular new records can come from incremental XML/JSON strings) and from time to time calls stat update and checks stat values; at some point user switches the stat update to auto mode to eliminate manual calls for update.

Use case 2:

user loads existing VMF schema (with data), configures statistics using call to user-provided code (e.g. functor object) and its auto update (it start updates for existing data); at some point user removes or changes the existing metadata - the statistics object switches to a manual mode since it needs full data re-scan for statistics update.

Use case 3 (not confirmed):

see Use case 1 or 2 + at some point user changes stat object config: adds some new statistics and remove some existing ones.

Use case 4:

see Use case 1 + eventually user saves metadata to media file including stat object config; later user loads this schema (with data) and gets pre-configured stat object (forced to manual update mode to prevent unnecessary calculations).