telefonicaid / fiware-cygnus

A connector in charge of persisting context data sources into other third-party databases and storage systems, creating a historical view of the context
https://fiware-cygnus.rtfd.io/
GNU Affero General Public License v3.0
65 stars 105 forks source link

[cygnus-ngsi][OrionStatsSink] Create #304

Open frbattid opened 9 years ago

frbattid commented 9 years ago

What about a sink receiving (certain) Orion notifications and (online) computing some kind of simple statistics for each entity's (numerical) attribute, in order to update new entities at Orion? This could the OrionStatsSink :)

More details:

Regarding output entities to be updated in Orion, certain naming conventions should be used, e.g. if the entity's name is some_entity_name then the output entity could be named some_entity_name_stats. Other possibility could be to add the statistic values as metadata of the original entity's attribute.

In general, this is an online way of obtaining a subset of all the statistics that the Short-Term historic will be able to generate from previously stored batches.

frbattid commented 9 years ago

Since this is an experimental sink, not required by FIWARE nor the IoT Platform, I'll develop it in parallel to real backlog, using my free time ;)

fgalan commented 9 years ago

Good idea!

Orion implements an "/statistics" operation (see https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_Installation_and_Administration_Guide#Statistics) but this OrionStatsSink would be a very useful complement.

frbattid commented 9 years ago

What do you think about feeding Orion? Is it better to update a new "_stats" sufixed entity containing the statistics? Or could we take advantage of the metadata and add the statistics to the already existing entity?

fgalan commented 9 years ago

I really love the idea of using attribute metadata for attach statistics to Orion entities.

frbattid commented 8 years ago

Some resources from a previous trial; the following ones can be directly reused:

This can be used as an inspiration of what must be done regarding the sink, but must be adapted to the latests changes in hte core (batches, data_model, etc):