Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardening/940_configurable_sth_resolution #1069

Conversation

frbattid
Copy link
Member

@frbattid frbattid commented Jun 1, 2016

Tests run: 66, Failures: 0, Errors: 0, Skipped: 0 --> cygnus-common
Tests run: 106, Failures: 0, Errors: 0, Skipped: 0 --> cygnus-ngsi

Relevant tests for this PR:

Running com.telefonica.iot.cygnus.sinks.NGSISTHSinkTest
[OrionSTHSink.configure] ------------------------ Non mandatory parameters get the default value when not configured
[OrionSTHSink.configure] -----------------  OK  - 'resolutions' gets the default value when not configured
[OrionSTHSink.configure] ------------------------ Non valid resolutions are detected
[OrionSTHSink.configure] -----------------  OK  - Invalid resolution 'week' has been detected
[OrionSTHSink.configure] ------------------------ Empty 'resolutions' means no persistence for any resolution
[OrionSTHSink.configure] -----------------  OK  - Empty 'resolutions' detected
  • (unofficial) e2e tests passed:
time=2016-06-01T15:42:49.043CEST | lvl=DEBUG | corr= | trans= | svc= | subsvc= | function=configure | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.sinks.NGSISTHSink[65] : [sth-sink] Reading configuration (resolutions=month,hour)
...
...
time=2016-06-01T15:43:06.292CEST | lvl=INFO | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=getEvents | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.handlers.NGSIRestHandler[264] : Received data ({  "subscriptionId" : "51c0ac9ed714fb3b37d7d5a8",  "originator" : "localhost",  "contextResponses" : [    {      "contextElement" : {        "attributes" : [          {            "name" : "temperature",            "type" : "centigrade",            "value" : "26.5"          }        ],        "type" : "Room",        "isPattern" : "false",        "id" : "Room1"      },      "statusCode" : {        "code" : "200",        "reasonPhrase" : "OK"      }    }  ]})
...
...
time=2016-06-01T15:43:07.054CEST | lvl=INFO | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=persistOne | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.sinks.NGSISTHSink[183] : [sth-sink] Persisting data at OrionSTHSink. Database: sth_frb, Collection: sth_/resolutiontest_Room1_Room.aggr, Data: 1464788586314,Room1,Room,temperature,centigrade,26.5,[]
time=2016-06-01T15:43:07.177CEST | lvl=DEBUG | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=insertContextDataAggregatedForResoultion | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.backends.mongo.MongoBackendImpl[271] : Prepopulating data, database=sth_frb, collection=sth_/resolutiontest_Room1_Room.aggr, query={ "_id" : { "attrName" : "temperature" , "origin" : { "$date" : "2016-06-01T00:00:00.000Z"} , "resolution" : "hour" , "range" : "day"} , "points.offset" : 13}, insert={ "$setOnInsert" : { "attrType" : "centigrade" , "points" : [ { "offset" : 0 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 1 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 2 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 3 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 4 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 5 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 6 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 7 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 8 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 9 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 10 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 11 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 12 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 13 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 14 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 15 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 16 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 17 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 18 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 19 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 20 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 21 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 22 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 23 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity}]}}
time=2016-06-01T15:43:07.179CEST | lvl=DEBUG | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=insertContextDataAggregatedForResoultion | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.backends.mongo.MongoBackendImpl[277] : Updating data, database=sth_frb, collection=sth_/resolutiontest_Room1_Room.aggr, query={ "_id" : { "attrName" : "temperature" , "origin" : { "$date" : "2016-06-01T00:00:00.000Z"} , "resolution" : "hour" , "range" : "day"} , "points.offset" : 13}, update={ "$set" : { "attrType" : "centigrade"} , "$inc" : { "points.$.samples" : 1 , "points.$.sum" : 26.5 , "points.$.sum2" : 702.25} , "$min" : { "points.$.min" : 26.5} , "$max" : { "points.$.max" : 26.5}}
time=2016-06-01T15:43:07.293CEST | lvl=DEBUG | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=insertContextDataAggregatedForResoultion | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.backends.mongo.MongoBackendImpl[271] : Prepopulating data, database=sth_frb, collection=sth_/resolutiontest_Room1_Room.aggr, query={ "_id" : { "attrName" : "temperature" , "origin" : { "$date" : "2016-01-01T00:00:00.000Z"} , "resolution" : "month" , "range" : "year"} , "points.offset" : 6}, insert={ "$setOnInsert" : { "attrType" : "centigrade" , "points" : [ { "offset" : 1 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 2 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 3 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 4 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 5 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 6 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 7 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 8 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 9 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 10 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 11 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity} , { "offset" : 12 , "samples" : 0 , "sum" : 0 , "sum2" : 0 , "min" : Infinity , "max" : -Infinity}]}}
time=2016-06-01T15:43:07.293CEST | lvl=DEBUG | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=insertContextDataAggregatedForResoultion | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.backends.mongo.MongoBackendImpl[277] : Updating data, database=sth_frb, collection=sth_/resolutiontest_Room1_Room.aggr, query={ "_id" : { "attrName" : "temperature" , "origin" : { "$date" : "2016-01-01T00:00:00.000Z"} , "resolution" : "month" , "range" : "year"} , "points.offset" : 6}, update={ "$set" : { "attrType" : "centigrade"} , "$inc" : { "points.$.samples" : 1 , "points.$.sum" : 26.5 , "points.$.sum2" : 702.25} , "$min" : { "points.$.min" : 26.5} , "$max" : { "points.$.max" : 26.5}}
time=2016-06-01T15:43:07.352CEST | lvl=INFO | corr=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | trans=3901bd84-b9ce-4cb8-b595-60dfbae1c20c | svc=frb | subsvc=/resolutiontest | function=processNewBatches | comp=cygnus-ngsi | msg=com.telefonica.iot.cygnus.sinks.NGSISink[400] : Finishing internal transaction (3901bd84-b9ce-4cb8-b595-60dfbae1c20c)

@gtorodelvalle
Copy link
Member

LGTM ;) Passing it over to @pcoello25 for additional review and merging if appropriate... :)

@pcoello25
Copy link
Contributor

LGTM

@pcoello25 pcoello25 merged commit 14b7120 into telefonicaid:develop Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants