How attribute of WatchOptions works?

Deals with generic topics such as logging, framework and so on. If you are not sure where to place your topic just put it here.

How attribute of WatchOptions works?

Postby Prakash » Fri Aug 03, 2018 6:16 am

Hi there,

I am trying to use Asynchronous methods of xServer and did some tests with xTour method "startPlanBasicTours()".
Need to understand the behavior of WatchOptions's attribute "progressUpdatePeriod" & "maximumPollingPeriod".
Because I am unable to understand after reading it from API and with my tests outcome.

After my tests, it seems both are working same.
My cases and there outcome:
Case1:
progressUpdatePeriod = 60000ms
maximumPollingPeriod = 60000ms
WatchJob has returned response in 1 minute

Case2.1:
progressUpdatePeriod = 10000ms
maximumPollingPeriod = 60000ms
WatchJob has returned response in 10 seconds

Case2.2:
progressUpdatePeriod = 60000ms
maximumPollingPeriod = 10000ms
WatchJob has returned response in 10 seconds

Case3.1:
progressUpdatePeriod = 0ms
maximumPollingPeriod = 60000ms
WatchJob has returned response instantly

Case3.2:
progressUpdatePeriod = 60000ms
maximumPollingPeriod = 0ms
WatchJob has returned response instantly

Case4:
progressUpdatePeriod = 0ms
maximumPollingPeriod = 0ms
WatchJob has returned response instantly

As per observation with the above cases, I found no difference in use of both attributes.
Could you please explain the difference between "progressUpdatePeriod" & "maximumPollingPeriod" and their affects.

Thanks in advance
Prakash Kumar
Developer
Webdirekt India Pvt. Ltd.
Prakash
 
Posts: 13
Joined: Mon Sep 14, 2015 5:21 am

Re: How attribute of WatchOptions works?

Postby Bernd Welter » Fri Aug 03, 2018 1:24 pm

Hello Prakash,

looks like the documentation is not that easy to understand or the required sections are not easy to find. Please take a look at this chapter from the programming guide:
Operation watchJob
The watchJob operation will return immediately if the job has state SUCCEEDED, FAILED, DELETED or UNKNOWN. Otherwise, the operation will wait for a status update. If no update happens before a set timeout (minWatchPeriod), watchJob will report the last status and only the run time of the job has changed.

WatchJob can return for progress updates while in state RUNNING. This is useful to inform end users about the progress. To enable this behaviour, specify the millisecond period for the progress updates. WatchJob will wait at least this period for a more up to date progress and report only the latest. If no new progress update arrives during the specified period, watchJob will wait for and return with the next available progress update. This mechanism helps to control server and client overhead by coalescing very frequent progress updates. If no progress waiting period is defined, progress will only be sent as part of status updates.

progressUpdatePeriod : Integer
If defined this optional parameter enables additional progress updates with the specified interval. If no new progress update arrives during the specified period, watchJob will wait for and return with the next available progress update. Important updates such as terminal states will always return immediately. The minimum period must be at least 250ms. If no progress waiting period is defined, progress will only be sent as part of status updates.

maximumPollingPeriod : Integer
Specifies the timeout after which watchJob will report the last status even if no further updates are available.If not specified a configured default is used.

So in the job states QUEUEING, RUNNING, STOPPING ("ing" indicates that something is going to happen) we apply the minWatchPeriod which refers to the JOB STATUS (a change means to proceed from one status to another. If a dima calculation proceeds from 30st row to 31st row this is not a status update because the status remains RUNNING).
With the progressUpdatePeriod you'd also recognize the progress from 31st row to 32nd row...
Sounds like maximumPollingPeriod is used equal to minWatchPeriod.
progressUpdatePeriod is therefore equal to the lower limit specified in the second chapter of WatchJob.

Does this answer your question? From my understanding these statements match fine with your scenarios.

Anyway: I'll forward your remark to DEV for a better description.

Bernd
Bernd Welter
Manager Technical Consulting & Requirement Engineering
Senior Technical Consultant Developer Components
PTV GROUP - Germany

Bernd at Youtube
User avatar
Bernd Welter
Site Admin
 
Posts: 1179
Joined: Mon Apr 14, 2014 10:28 am


Return to Generic questions