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

Feature/add throttling #1085

Merged
merged 22 commits into from
Feb 5, 2024
Merged

Feature/add throttling #1085

merged 22 commits into from
Feb 5, 2024

Conversation

ranim-n
Copy link
Contributor

@ranim-n ranim-n commented Jan 22, 2024

No description provided.

@github-actions github-actions bot added the feature New feature or request label Jan 22, 2024
Copy link
Contributor

github-actions bot commented Jan 22, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link
Contributor

github-actions bot commented Jan 22, 2024

Test Results

 55 files  ±0   55 suites  ±0   1m 18s ⏱️ +5s
908 tests +4  908 ✅ +4  0 💤 ±0  0 ❌ ±0 
947 runs  +4  947 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit 4afeb58. ± Comparison against base commit d0b294d.

This pull request removes 95 and adds 20 tests. Note that renamed tests count towards both.
                    "@value": "/A/B"
                    "@value": "/C/D"
                    "@value": 20
                    "…
                  "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
                  "@value": "2020-03-25T08:29:17.965206Z"
                  "@value": "2020-03-25T08:33:17.965206Z"
                  "@value": "2020-03-25T0…
                  "@value": "Beehive_incoming_123"
                  "@value": 550.0
…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [10] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=7a46f3aa-12d5-4f6e-8a56-2d6a2ad6fe64, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=STRING, datasetId=null, createdAt=2024-02-01T18:22:36.704132301Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=6c88f57b-3074-44aa-a75b-d99228a0975d, value=Beehive_incoming_123, time=2020-03-25T08:29:17.965206Z), SimplifiedAttributeInstanceRe…, withTemporalValues=true, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/hasValues": [
        {
          "@list": [
            {
              "@list": [
                {
                  "@value": "Beehive_incoming_123"
                },
                {
                  "@value": "2020-03-25T0…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [11] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=e83a870c-8e5d-4ee2-83f5-30dc90d17788, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=urn:ngsi-ld:Dataset:45678, createdAt=2024-02-01T18:22:36.704132301Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[SimplifiedAttributeInstanceResult(temporalEntityAttribute=55a66507-04b9-4f43-b282-4269829d0be5, value=urn:ngsi-ld:Entity:1234, time=2020-03-25T08:29:17.965206Z), S…, withTemporalValues=true, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Relationship"
      ],
      "https://uri.etsi.org/ngsi-ld/datasetId": [
        {
          "@id": "urn:ngsi-ld:Dataset:45678"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/hasObjects": [
        {
          "@list": [
            {
              "@list": [
                {
…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [12] scopeHistory=[SimplifiedScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/A/B, /C/D], time=2020-03-25T08:29:17.965206Z), SimplifiedScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/C/D], time=2020-03-25T09:29:17.965206Z)], attributeAndResultsMap={}, withTemporalValues=true, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://uri.etsi.org/ngsi-ld/scope": {
    "@type": [
      "https://uri.etsi.org/ngsi-ld/Property"
    ],
    "https://uri.etsi.org/ngsi-ld/hasValues": [
      {
        "@list": [
          {
            "@list": [
              {
                "@list": [
                  {
                    "@value": "/A/B"
                  },
                  {
                    "@value": "/C/D"
   …
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [13] scopeHistory=[FullScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/A/B, /C/D], time=2020-03-25T08:29:17.965206Z, timeproperty=modifiedAt, sub=null), FullScopeInstanceResult(entityId=urn:ngsi-ld:BeeHive:TESTC, scopes=[/C/D], time=2020-03-25T09:29:17.965206Z, timeproperty=modifiedAt, sub=null)], attributeAndResultsMap={}, withTemporalValues=false, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://uri.etsi.org/ngsi-ld/scope": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/hasValue": [
        {
          "@value": "/A/B"
        },
        {
          "@value": "/C/D"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/modifiedAt": [
        {
          "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
     …
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [1] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2024-02-01T18:22:36.692436273Z, modifiedAt=null, contexts=[http://localhost:8093/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=d236c073-d94e-4b66-9534-29a23620011c, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontolog…, withTemporalValues=false, withAudit=true, expectation=[
   {
      "@id": "urn:ngsi-ld:BeeHive:TESTC",
      "@type": [
         "https://ontology.eglobalmark.com/apic#BeeHive"
      ],
      "https://ontology.eglobalmark.com/apic#incoming": [
         {
            "@type": [
               "https://uri.etsi.org/ngsi-ld/Property"
            ],
            "https://uri.etsi.org/ngsi-ld/observedAt": [
               {
                  "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
                  "@value": "2020-03-25T08:33:17.965206Z"
               }
…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [1] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=72176fbc-49c3-4ace-85d3-5544c16681b0, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=NUMBER, datasetId=null, createdAt=2024-02-01T18:22:36.704132301Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=51f2fb76-ef83-4c86-b8c8-e73362afc25a, payload={"@type":["https://uri.etsi.org/ngsi-ld/Property"],"https://uri.etsi.org/ngsi-ld/observedA…, withTemporalValues=false, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/observedAt": [
        {
          "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
          "@value": "2020-03-25T08:29:17.965206Z"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/instanceId": [
        {
          "@id":…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [2] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2024-02-01T18:22:36.692436273Z, modifiedAt=null, contexts=[http://localhost:8093/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=a893a271-421b-4985-a841-2b1f9c7e5a15, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontolog…, withTemporalValues=true, withAudit=false, expectation=[
  {
    "@id": "urn:ngsi-ld:BeeHive:TESTC",
    "@type": [
      "https://ontology.eglobalmark.com/apic#BeeHive"
    ],
    "https://ontology.eglobalmark.com/apic#incoming": [
      {
        "@type": [
          "https://uri.etsi.org/ngsi-ld/Property"
        ],
        "https://uri.etsi.org/ngsi-ld/hasValues": [
          {
            "@list": [
              {
                "@list": [
                  {
                    "@value": 20
                  },
                  {
                    "…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [2] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=b5d11834-f4f9-4382-a58e-4054826f03e6, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Relationship, attributeValueType=STRING, datasetId=null, createdAt=2024-02-01T18:22:36.704132301Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=36236ffd-9ba4-4504-9db4-b6685fd2f243, payload={"@type":["https://uri.etsi.org/ngsi-ld/Relationship"],"https://uri.etsi.org/ngsi-ld/o…, withTemporalValues=false, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Relationship"
      ],
      "https://uri.etsi.org/ngsi-ld/observedAt": [
        {
          "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
          "@value": "2020-03-25T08:29:17.965206Z"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/instanceId": [
        {
          "@…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [3] entityTemporalResults=[EntityTemporalResult(entityPayload=EntityPayload(entityId=urn:ngsi-ld:BeeHive:TESTC, types=[https://ontology.eglobalmark.com/apic#BeeHive], scopes=null, createdAt=2024-02-01T18:22:36.692436273Z, modifiedAt=null, contexts=[http://localhost:8093/jsonld-contexts/apic-compound.jsonld], payload=JsonByteArrayInput{{}}, specificAccessPolicy=null), scopeHistory=[], teaInstancesResult={TemporalEntityAttribute(id=e371a692-87f8-4357-aacb-445db2b0fd05, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontolog…, withTemporalValues=true, withAudit=false, expectation=[
  {
    "@id": "urn:ngsi-ld:BeeHive:TESTC",
    "@type": [
      "https://ontology.eglobalmark.com/apic#BeeHive"
    ],
    "https://ontology.eglobalmark.com/apic#incoming": [
      {
        "@type": [
          "https://uri.etsi.org/ngsi-ld/Property"
        ],
        "https://uri.etsi.org/ngsi-ld/hasValues": [
          {
            "@list": [
              {
                "@list": [
                  {
                    "@value": 20
                  },
                  {
                    "…
com.egm.stellio.search.util.TemporalEntityBuilderTests ‑ [3] scopeHistory=[], attributeAndResultsMap={TemporalEntityAttribute(id=329af108-8bcc-435d-aa31-e35d30a67843, entityId=urn:ngsi-ld:BeeHive:TESTC, attributeName=https://ontology.eglobalmark.com/apic#incoming, attributeType=Property, attributeValueType=NUMBER, datasetId=urn:ngsi-ld:Dataset:01234, createdAt=2024-02-01T18:22:36.704132301Z, modifiedAt=null, payload=JsonByteArrayInput{{}})=[FullAttributeInstanceResult(temporalEntityAttribute=7a7e7666-e05e-40f1-b01a-c22499867b15, payload={"@type":["https://uri.etsi.org/ngsi-ld/Property"],"https://uri.etsi.…, withTemporalValues=false, withAudit=false, expectation={
  "@id": "urn:ngsi-ld:BeeHive:TESTC",
  "@type": [
    "https://ontology.eglobalmark.com/apic#BeeHive"
  ],
  "https://ontology.eglobalmark.com/apic#incoming": [
    {
      "@type": [
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/observedAt": [
        {
          "@type": "https://uri.etsi.org/ngsi-ld/DateTime",
          "@value": "2020-03-25T08:29:17.965206Z"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/instanceId": [
        {
          "@id":…
…

♻️ This comment has been updated with latest results.

@ranim-n
Copy link
Contributor Author

ranim-n commented Jan 22, 2024

I have read the CLA Document and I hereby sign the CLA

@bobeal bobeal marked this pull request as draft January 22, 2024 10:53
@bobeal
Copy link
Member

bobeal commented Jan 31, 2024

you can set the PR as ready for review, there are only minor fixes remaining

@ranim-n ranim-n marked this pull request as ready for review January 31, 2024 16:40
Comment on lines 9 to 13
fun unsupportedSubscriptiondAttributeMessage(subscriptionId: URI, key: String) =
"Subscription $subscriptionId has unsupported attribute: $key"

fun invalidSubscriptiondAttributeMessage(subscriptionId: URI, key: String) =
"Subscription $subscriptionId has invalid attribute: $key"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just spotted that there is an extra d at the end of Subscription in the name of the functions

Copy link

sonarqubecloud bot commented Feb 4, 2024

@ranim-n ranim-n merged commit bef2f83 into develop Feb 5, 2024
10 checks passed
@ranim-n ranim-n deleted the feature/add-throttling branch February 5, 2024 07:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants