View Issue Details

IDProjectCategoryView StatusLast Update
0004459Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2022-10-12 16:46
ReporterBernd Edlinger Assigned ToAlexander Allmendinger  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version8.1
Product Version1.03.341.383 
Target Version1.03Fixed in Version1.03.341.383 
Summary0004459: Performance issue with Subscription Publish Min 02/002.js and 003.js
Description

The test case uses 5.000 MIs for this test unit.
But the time in the CreateMonitoredItemsHelper and probably also
the WriteHelper when 5.000 items are processed approaches the
PublishingInterval of 5000 ms, which makes the test case fail.

I can make the test cases succeed by preparing the big create
MI and Write request, before creating the subscription as follows:

--- "maintree/Subscription Services/Subscription Publish Min 02/Test Cases/002.js" 2018-11-06 18:09:44.000000000 +0100
+++ "maintree/Subscription Services/Subscription Publish Min 02/Test Cases/002.js" 2018-11-13 21:25:53.637207721 +0100
@@ -43,18 +43,47 @@
function deleteSub5106004() {
// read all items first
ReadHelper.Execute( { NodesToRead: items } );
+

  • var writeRequest = new UaWriteRequest();
  • var writeResponse = new UaWriteResponse();
  • writeRequest.RequestHeader = UaRequestHeader.New( { Session: WriteHelper.Session } );
  • var createMonitoredItemsRequest = new UaCreateMonitoredItemsRequest();
  • var createMonitoredItemsResponse = new UaCreateMonitoredItemsResponse();
  • createMonitoredItemsRequest.RequestHeader = UaRequestHeader.New( { Session: CreateMonitoredItemsHelper.Session } );
  • createMonitoredItemsRequest.TimestampsToReturn = TimestampsToReturn.Both;
  • for (var w=0; w<items.length; w++) {
  • UaVariant.Increment( { Value: items[w].Value } );
  • writeRequest.NodesToWrite[w].NodeId = items[w].NodeId;
  • writeRequest.NodesToWrite[w].AttributeId = items[w].AttributeId;
  • writeRequest.NodesToWrite[w].IndexRange = items[w].IndexRange;
  • writeRequest.NodesToWrite[w].Value.Value = items[w].Value.Value;
  • createMonitoredItemsRequest.ItemsToCreate[w] = new UaMonitoredItemCreateRequest();
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.NodeId = items[w].NodeId;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.AttributeId = items[w].AttributeId;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.IndexRange = items[w].IndexRange;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.DataEncoding = items[w].DataEncoding;
  • createMonitoredItemsRequest.ItemsToCreate[w].MonitoringMode = items[w].MonitoringMode;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.ClientHandle = items[w].ClientHandle;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.SamplingInterval = items[w].SamplingInterval;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.QueueSize = items[w].QueueSize;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.DiscardOldest = items[w].DiscardOldest;
  • }// for...
  • // create subscription
    var subscription = new Subscription2( { PublishingInterval:5000, RequestedLifetimeCount:10, MaxKeepAliveCount:1 } );
    //subscription
    if( !CreateSubscriptionHelper.Execute( { Subscription: subscription } ) ) addError( "Error creating subscription." );
    else {

  • if( !CreateMonitoredItemsHelper.Execute( { ItemsToCreate: items, TimestampsToReturn: TimestampsToReturn.Both, SubscriptionId: subscription } ) ) {
  • createMonitoredItemsRequest.SubscriptionId = subscription.SubscriptionId;
  • var uaStatus = CreateMonitoredItemsHelper.Session.createMonitoredItems ( createMonitoredItemsRequest, createMonitoredItemsResponse );
  • if( !uaStatus.isGood() ) {
    DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscription } );
    return( false );
    }
    // write a new value to all subscribed items
  • for( var i=0; i<items.length; i++ ) UaVariant.Increment( { Value: items[i].Value } );
  • WriteHelper.Execute( { NodesToWrite: items, ReadVerification: false } );
  • WriteHelper.Session.write( writeRequest, writeResponse );
    // queue 2 publish requests:
    var timeoutSetting = parseInt( 3 * readSetting( "/Server Test/Session/DefaultTimeoutHint" ).toString(), 10 );
    for( var q=0; q<2; q++ ) {

--- "maintree/Subscription Services/Subscription Publish Min 02/Test Cases/003.js" 2018-11-06 18:09:44.000000000 +0100
+++ "maintree/Subscription Services/Subscription Publish Min 02/Test Cases/003.js" 2018-11-13 21:26:33.359602327 +0100
@@ -61,12 +61,41 @@
// read all items first
ReadHelper.Execute( { NodesToRead: items } );

  • var writeRequest = new UaWriteRequest();
  • var writeResponse = new UaWriteResponse();
  • writeRequest.RequestHeader = UaRequestHeader.New( { Session: WriteHelper.Session } );
  • var createMonitoredItemsRequest = new UaCreateMonitoredItemsRequest();
  • var createMonitoredItemsResponse = new UaCreateMonitoredItemsResponse();
  • createMonitoredItemsRequest.RequestHeader = UaRequestHeader.New( { Session: CreateMonitoredItemsHelper.Session } );
  • createMonitoredItemsRequest.TimestampsToReturn = TimestampsToReturn.Both;
  • for (var w=0; w<items.length; w++) {
  • UaVariant.Increment( { Value: items[w].Value } );
  • writeRequest.NodesToWrite[w].NodeId = items[w].NodeId;
  • writeRequest.NodesToWrite[w].AttributeId = items[w].AttributeId;
  • writeRequest.NodesToWrite[w].IndexRange = items[w].IndexRange;
  • writeRequest.NodesToWrite[w].Value.Value = items[w].Value.Value;
  • createMonitoredItemsRequest.ItemsToCreate[w] = new UaMonitoredItemCreateRequest();
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.NodeId = items[w].NodeId;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.AttributeId = items[w].AttributeId;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.IndexRange = items[w].IndexRange;
  • createMonitoredItemsRequest.ItemsToCreate[w].ItemToMonitor.DataEncoding = items[w].DataEncoding;
  • createMonitoredItemsRequest.ItemsToCreate[w].MonitoringMode = items[w].MonitoringMode;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.ClientHandle = items[w].ClientHandle;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.SamplingInterval = items[w].SamplingInterval;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.QueueSize = items[w].QueueSize;
  • createMonitoredItemsRequest.ItemsToCreate[w].RequestedParameters.DiscardOldest = items[w].DiscardOldest;
  • }// for...
  • // create subscription
    var subscription = new Subscription2( { PublishingInterval: 5000, RequestedLifetimeCount: 10, MaxKeepAliveCount: 1 } );
    //subscription
    if( !CreateSubscriptionHelper.Execute( { Subscription: subscription } ) ) addError( "Error creating subscription." );
    else {

  • if( !CreateMonitoredItemsHelper.Execute( { ItemsToCreate: items, TimestampsToReturn: TimestampsToReturn.Both, SubscriptionId: subscription } ) ) {
  • createMonitoredItemsRequest.SubscriptionId = subscription.SubscriptionId;
  • var uaStatus = CreateMonitoredItemsHelper.Session.createMonitoredItems ( createMonitoredItemsRequest, createMonitoredItemsResponse );
  • if( !uaStatus.isGood() ) {
    DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscription } );
    return( false );
    }
    @@ -92,11 +121,7 @@

     // write to ALL items
     PublishHelper.WaitInterval( { Items: items, Subscription: subscription } );
  • for( var w=0; w<items.length; w++ ) {
  • UaVariant.Increment( { Value: items[w].Value } );
  • items[w].WrittenValue = items[w].Value.Value.clone();
  • }// for( var w=0; w<items.length; w++ )
  • WriteHelper.Execute( { NodesToWrite:items, ReadVerification:false } );
  • WriteHelper.Session.write( writeRequest, writeResponse );

     // wait for our 2 publish requests to come back... but wait a MAX of

    @@ -189,7 +214,18 @@
    //--------------------------------------------------------------

     // small delay and then clean-up
  • for (var i = 0; i < 250; i++) UaDateTime.CountDown({ Msecs: 10, SuppressMessage: true });;
  • for (var i=0; i<250; i++) UaDateTime.CountDown({ Msecs: 10, SuppressMessage: true });
  • for (var w=0; w<items.length; w++) {
  • var currentResult = createMonitoredItemsResponse.Results[w];
  • if ( currentResult.StatusCode.isGood() ) {
  • items[w].IsCreated = true;
  • items[w].MonitoredItemId = currentResult.MonitoredItemId;
  • items[w].RevisedQueueSize = currentResult.RevisedQueueSize;
  • items[w].RevisedSamplingInterval = currentResult.RevisedSamplingInterval;
  • items[w].SubscriptionId = createMonitoredItemsRequest.SubscriptionId;
  • }
  • }
  •  DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: items, SubscriptionId: subscription } );
     DeleteSubscriptionsHelper.Execute( { SubscriptionIds: subscription } );
TagsNo tags attached.
Files Affected

Relationships

has duplicate 0004643 closedAlexander Allmendinger Subscription Services/Subscription Publish Min 02/003.js fails due to timing issue 
related to 0004471 closedHannes Mezger Subscription Services/Subscription Publish Min 02/002.js 
related to 0004472 closedHannes Mezger Subscription Services/Subscription Publish Min 02/003.js 

Activities

Alexander Allmendinger

2018-12-14 10:04

developer   ~0009701

Suggestion looks appropriate and has been implemented accordingly.

Paul Hunkar

2019-08-02 04:11

administrator   ~0010671

Reviewed in cmp call 8/1/2019

Issue History

Date Modified Username Field Change
2018-11-13 20:44 Bernd Edlinger New Issue
2018-12-07 14:27 Paul Hunkar Assigned To => Alexander Allmendinger
2018-12-07 14:27 Paul Hunkar Status new => assigned
2018-12-14 10:04 Alexander Allmendinger Note Added: 0009701
2018-12-14 10:04 Alexander Allmendinger Status assigned => resolved
2018-12-14 10:04 Alexander Allmendinger Fixed in Version => 1.03.341.383
2018-12-14 10:04 Alexander Allmendinger Resolution open => fixed
2018-12-19 10:21 Alexander Allmendinger Relationship added related to 0004471
2018-12-19 10:35 Alexander Allmendinger Relationship added related to 0004472
2019-01-28 14:10 Paul Hunkar Category Script Issue => 1 - Script Issue
2019-08-02 04:11 Paul Hunkar Target Version => 1.03
2019-08-02 04:11 Paul Hunkar Status resolved => closed
2019-08-02 04:11 Paul Hunkar Note Added: 0010671
2022-10-12 16:46 Paul Hunkar Relationship added has duplicate 0004643