Code Monkey home page Code Monkey logo

historical-datastore's People

Contributors

dschowta avatar farshidtz avatar krylovsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

historical-datastore's Issues

Create API specs proposal for the IoT Datastore service

Don't like the new name? Visit: https://docs.linksmart.eu/display/LSI/OGC+SersorThings+Service+Candidates

Considering the status of current OGC-ST implementations and the complexity of creating another fully-compliant OGC-ST service, we would like to propose the use of OGC-ST data model alongside a custom and simplified RESTful API. This task will focus on creating OpenAPI specs for the aforementioned service.

[LS-200] created by tavakoli

Create a team for OGC in LinkSmart

DoD:

  • A team to support support of OGC Sensorthings API for HDS is formed
  • Roles are defines for each member

[LS-286] created by carvajal

HDS automatic registration of DS

It is much more convenient to start submitting SenML data without the need to register data sources beforehand.

An optional configurable feature can enable automatic registration of data source upon first submission of a SenML entry.

[LS-248] created by tavakoli

HDS not persisting MQTT credentials

Jannis Warnat: when I register resources in HDS that require a password for the MQTT broker, these passwords are not stored in LevelDB (only *****). Do you know whether there was a conscious decision to do so for security reasons or can I change this? I understand that we probably do not want users to see the password by just checking the /registry endpoint. But it would be much easier if HDS could retrieve the passwords from LevelDB after a restart. I guess I would have to analyze where the json is "marshalled".

[LS-350] created by tavakoli

OGC Sensor Things compliance

Compliance to OGCSensorThings > =1.0: IoT Device Gateway, Resource Catalogue, IoT Agents, Historicla Datastore, Sensor Platform

[LS-107] created by marco.jahn

Refactor HDS code

ToDo:

  • Remove local clients and use interfaces
  • Remove notifications and instead pass control functions to registry
  • Remove elog nonsense and log flags, make time optional
  • Cleanup main
  • Remove Mongodb
  • Remove multi sc support
  • Improve file naming

[LS-479] created by tavakoli

Add swagger specification

Create Swagger specification (either inside components or external)

[LS-109] created by marco.jahn

Support WoT Things description for representing data

This issue is created to support Web of things Things description specification for storage of the metadata.
Example

{
    "@context": "https://www.w3.org/2019/wot/td/v1",
    "id": "urn:dev:ops:32473-WoTTemp-1234",
    "title": "MyLampThing",
    "securityDefinitions": {
        "basic_sc": {"scheme": "basic", "in":"header"}
    },
    "security": ["basic_sc"],
    "base": "/data/",
    "properties": {
        "source" : { 
            "type": "float",
            "forms": [{
		"href": "https://gw1.iot/status", 
	         "contentType": "application/senml+json",
		 "op": ["readproperty", "writeproperty"],
		 "security": ["basic_sc"]
	    }],
        },
        "storage" : { 
	   "readOnly" : true,
            "type": "float",
            "forms": [{"href": "/data/urn:dev:ops:32473-WoTTemp-1234","security": ["basic_sc"]}]
        }
    }
}

In the above example. properties/source property represents the original device that produced the data. On the other hand, properties/storage represents the data stored as part of historical datastore.
The sample senml:

[
  {"bn":"urn:dev:ops:32473-WoTTemp-1234","bu":"Cel","t":1.276020076e+09, "v":20},
  {"t":1.276020091e+09, "v":23.5},
]

Turn aggregations into SenML

How it is now:

{
    "bn""string",
    "bu""string",
    "bts""int",
    "bte""int",
    "e": [
{
    "n""string",
    "ts""int",
    "te""int",
    "mean""float",
    "stddev""float",
    "sum""float",
    "min""float",
    "max""float",
    "median""float"
}
    ]
}

The aggregate could be instead part of the name. "te" is not needed. The rest can fit into SenML.

[LS-485] created by tavakoli

HDS SenML data submission without uuid

This should allow submission of data to /data endpoint without explicitly providing the ID. The ID will be retrieved based on the SenML name field.

[LS-247] created by tavakoli

Road to HDS v1

Historical Datastore should be improved to support expected use-cases with simple and pragmatic APIs.

 

Use cases:

  • Low dimensional time-series storage and retrieval 
  • High dimensional time-series storage and retrieval
  • Log storage and retrieval
  • Lightweight storage on IoT devices by using embedded DBs such as Leveldb, Boltdb, Sqlite

Features:

  • Retention 
  • Simple aggregation (persistent) 
  • HTTP API 
  • MQTT connector 
  • Annotation
  • Query with mathematical functions

[LS-446] created by tavakoli

Create retention policies during startup

To optimize the backend and fix race condition issue between data and aggregation storages, retention policies can be instead configured prior to runtime and created during startup. The datasources then will only be able to use the preconfigured retention policies.

[LS-346] created by tavakoli

Internal server error when querying out of range pages

2018/08/10 09:45:05 [hds] PANIC: runtime error: index out of range
goroutine 11212 [running]:
runtime/debug.Stack(0xc420290f18, 0x9546c0, 0xd2add0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
main.recoverHandler.func1.1(0x7fe05de67670, 0xc420a9e140)
	/data/src/code.linksmart.eu/hds/historical-datastore/handlers.go:31 +0x5a
panic(0x9546c0, 0xd2add0)
	/usr/local/go/src/runtime/panic.go:502 +0x229
code.linksmart.eu/hds/historical-datastore/data.(*InfluxStorage).Query(0xc420133300, 0x0, 0xe7791f700, 0xd3c7a0, 0x39232b9b, 0xed2ff55a1, 0x0, 0x9fa41c, 0x4, 0xffffffffffffffff, ...)
	/data/src/code.linksmart.eu/hds/historical-datastore/data/influxdb.go:191 +0x13b1
code.linksmart.eu/hds/historical-datastore/data.(*HTTPAPI).Query(0xc42019acc0, 0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/data/http.go:301 +0x702
code.linksmart.eu/hds/historical-datastore/data.(*HTTPAPI).Query-fm(0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/main.go:155 +0x48
net/http.HandlerFunc.ServeHTTP(0xc42015bc50, 0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/usr/local/go/src/net/http/server.go:1947 +0x44
main.commonHeaders.func1(0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/router.go:65 +0x195
net/http.HandlerFunc.ServeHTTP(0xc4201af820, 0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/usr/local/go/src/net/http/server.go:1947 +0x44
main.recoverHandler.func1(0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/handlers.go:35 +0x95
net/http.HandlerFunc.ServeHTTP(0xc4201af840, 0x7fe05de67670, 0xc420a9e140, 0xc420105f00)
	/usr/local/go/src/net/http/server.go:1947 +0x44
main.loggingHandler.func1(0xa6f040, 0xc4201362a0, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/handlers.go:21 +0x236
net/http.HandlerFunc.ServeHTTP(0xc4201af860, 0xa6f040, 0xc4201362a0, 0xc420105f00)
	/usr/local/go/src/net/http/server.go:1947 +0x44
code.linksmart.eu/hds/historical-datastore/vendor/github.com/gorilla/context.ClearHandler.func1(0xa6f040, 0xc4201362a0, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/vendor/github.com/gorilla/context/context.go:141 +0x8b
net/http.HandlerFunc.ServeHTTP(0xc4201af880, 0xa6f040, 0xc4201362a0, 0xc420105f00)
	/usr/local/go/src/net/http/server.go:1947 +0x44
code.linksmart.eu/hds/historical-datastore/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc4201a8370, 0xa6f040, 0xc4201362a0, 0xc420105f00)
	/data/src/code.linksmart.eu/hds/historical-datastore/vendor/github.com/gorilla/mux/mux.go:114 +0xdc
net/http.serverHandler.ServeHTTP(0xc420152820, 0xa6f040, 0xc4201362a0, 0xc420104d00)
	/usr/local/go/src/net/http/server.go:2694 +0xbc
net/http.(*conn).serve(0xc4203acf00, 0xa70c40, 0xc42043a440)
	/usr/local/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2795 +0x27b
2018/08/10 09:45:05 [hds] "GET /data/05bf9f68-96ac-40fb-be1c-35ff375d5583?page=22 HTTP/1.1" 500 22 19.464926ms
[LS-444] created by tavakoli

HDS is image is broker

The default configuration of HDS is not working
DoD:
HDS docker image runs without issues

[LS-379] created by carvajal

Improve Datasource representation

Datasource v0.5

{
      "id": "9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "url": "/registry/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "data": "/data/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
      "resource": "13/0/49/4/power",
      "meta": {
"name": "Philip's laptop"
      },
      "connector": {
"mqtt": {
  "url": "ssl://demo.linksmart.eu:8883",
  "topic": "LS/v2/ZGW/linksmart-philip/senml",
  "qos": 1
}
      },
      "retention": "1w",
      "aggregation": [
{
  "id": "4efaf6fb",
  "interval": "1m",
  "data": "/aggr/4efaf6fb/9b1921c1-b20f-496a-a127-b5a01f0a91a5",
  "aggregates": [
    "mean"
  ],
  "retention": ""
}
      ],
      "type": "float",
      "format": "application/senml+json"
}

Problems

  • two identifiers (id and resource) needed during different operations.
  • resource is the name attribute in SenML
  • "format" carries no important information (it's the same for all)
  • url, data, aggr.data are shows as absolute paths but in fact they are relative to the public endpoint.

[LS-447] created by tavakoli

Integration test for HDS

DoD:

  • A table of integration test is created to measure the coverage 
  • Part of these test is performed

[LS-282] created by devasya

Simplify filtering API

The filtering API of HDS can be simplified by removing the {type} and taking the /many behaviour as default. The efficiency effects should be considered.

  • Get datasource with name:
    /registry/one/name/equals/home/bedroom/temperature
  • Filter all datasources with prefix home in name:
    /registry/many/name/prefix/home
  • Filter all datasources based on address meta field:
    /registry/many/meta.address/contains/Bonn

[LS-430] created by tavakoli

Change package name to Github

The go package name should be changed from code.linksmart.eu/hds/historical-datastore to github.com/linksmart/historical-datastore.

Internal aggreagation support

Supporting aggregation function in HDS:

  • Should support API based aggregation (Separate API for creation of aggregations)
  • Support basic aggregations such as
    • Mean
    • Sum
    • Last value
    • custom with a go or python code
  • This aggregation should be triggered via
    • Periodic (cron based)
    • Data based (triggered whenever a new data point is inserted)

Platform Integration Test

Creating integration tests between the Service Catalog and each Linksmart® Service

[LS-254] created by carvajal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.