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

Fix condition timer and add option to override publishing intervals #2297

Merged
merged 30 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/docker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ This setup is certainly experimental because:
- Alpine images must be used if you want to run for more than 3 seconds with said limit. The official OPC Publisher images are based on Alpine, but the ones built from the repository do not.
- We disable meta data loading which has significant memory overhead. But you might need it.
- The publisher publishes 11 nodes with value changes every 1 second. There is no buffering enabled, the messages are immediately dropped after encoding.
- The setup is continously under GC pressure and a good chunk of CPU is used for garbage collection and compression.
- The setup is continuously under GC pressure and a good chunk of CPU is used for garbage collection and compression.
- Open Telemetry and Prometheus metrics are disabled as they consume a large amount of memory.
- The .net GC is configured to be over aggressive which are not ideal for production scenarios.
2 changes: 1 addition & 1 deletion deploy/iotedge/eflow-setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"restartPolicy": "always",
"settings": {
"image": "mcr.microsoft.com/iotedge/opc-publisher:latest",
"createOptions": "{\"HostConfig\":{\"Binds\": [\"/tmp/host:/mount\"]},\"User\":\"root\",\"Cmd\":[\"--strict\",\"--pf=/mount/pn.json\",\"--pki=/mount/pki\",\"--cf\",\"--mm=PubSub\",\"--me=Json\",\"--cl=5\",\"--sl\",\"--aa\"]}"
"createOptions": "{\"HostConfig\":{\"Binds\": [\"/tmp/host:/mount\"],\"PortBindings\":{\"443/tcp\":[{\"HostPort\":\"8081\"}]}},\"User\":\"root\",\"Cmd\":[\"--strict\",\"--pf=/mount/pn.json\",\"--pki=/mount/pki\",\"--cf\",\"--mm=PubSub\",\"--me=Json\",\"--cl=5\",\"--sl\",\"--aa\"]}"
}
},
"opcplc": {
Expand Down
93 changes: 85 additions & 8 deletions docs/opc-publisher/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -862,22 +862,98 @@ This section lists the diagnostics APi provided by OPC Publisher providing
name.


<a name="getconnectiondiagnostic"></a>
#### GetConnectionDiagnostic
<a name="getactiveconnections"></a>
#### GetActiveConnections
```
GET /v2/connections
```


##### Description
Get all active connections the publisher is currently managing.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|The operation was successful.|< [ConnectionModel](definitions.md#connectionmodel) > array|
|**500**|An unexpected error occurred|[ProblemDetails](definitions.md#problemdetails)|


##### Produces

* `application/json`
* `application/x-msgpack`


<a name="getchanneldiagnostics"></a>
#### GetChannelDiagnostics
```
GET /v2/diagnostics/channels
```


##### Description
Get channel diagnostic information for all connections.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|The operation was successful.|< [ChannelDiagnosticModel](definitions.md#channeldiagnosticmodel) > array|
|**500**|An unexpected error occurred|[ProblemDetails](definitions.md#problemdetails)|


##### Produces

* `application/json`
* `application/x-msgpack`


<a name="watchchanneldiagnostics"></a>
#### WatchChannelDiagnostics
```
GET /v2/diagnostics/channels/watch
```


##### Description
Get channel diagnostic information for all connections. The first set of diagnostics are the diagnostics active for all connections, continue reading to get updates.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|The operation was successful.|[ChannelDiagnosticModelIAsyncEnumerable](definitions.md#channeldiagnosticmodeliasyncenumerable)|
|**500**|An unexpected error occurred|[ProblemDetails](definitions.md#problemdetails)|


##### Produces

* `application/json`
* `application/x-msgpack`


<a name="getconnectiondiagnostics"></a>
#### GetConnectionDiagnostics
```
GET /v2/diagnostics/connections
```


##### Description
Get connection diagnostic information for all connections. The first set of diagnostics are the diagnostics active for all connections, continue reading to get updates.
Get diagnostics for all active clients including server and client session diagnostics.


##### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|The operation was successful.|[ConnectionDiagnosticModelIAsyncEnumerable](definitions.md#connectiondiagnosticmodeliasyncenumerable)|
|**200**|The operation was successful.|[ConnectionDiagnosticsModelIAsyncEnumerable](definitions.md#connectiondiagnosticsmodeliasyncenumerable)|
|**408**|The operation timed out.|[ProblemDetails](definitions.md#problemdetails)|
|**500**|An unexpected error occurred|[ProblemDetails](definitions.md#problemdetails)|


Expand Down Expand Up @@ -2935,10 +3011,11 @@ Remove the published nodes entry for a specific data set writer in a writer grou

##### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**dataSetWriterGroup** <br>*required*|The writer group name of the entry|string|
|**Path**|**dataSetWriterId** <br>*required*|The data set writer identifer of the entry|string|
|Type|Name|Description|Schema|Default|
|---|---|---|---|---|
|**Path**|**dataSetWriterGroup** <br>*required*|The writer group name of the entry|string||
|**Path**|**dataSetWriterId** <br>*required*|The data set writer identifer of the entry|string||
|**Query**|**force** <br>*optional*|Force delete all writers even if more than one were found. Does not error when none were found.|boolean|`"false"`|


##### Responses
Expand Down
23 changes: 21 additions & 2 deletions docs/opc-publisher/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ Subscription settings
interval setting of a subscription created with
an OPC UA server. This value is used if an
explicit publishing interval was not configured.
When setting `--op=0` the server decides the
lowest publishing interval it can support.
Default: `1000`.
Also can be set using `DefaultPublishingInterval`
environment variable in the form of a duration
Expand All @@ -570,13 +572,13 @@ Subscription settings
Specifies the default number of publishing
intervals before a keep alive is returned with
the next queued publishing response.
Default: `10`.
Default: `0`.
--slt, --lifetimecount, --DefaultLifetimeCount=VALUE
Default subscription lifetime count which is a
multiple of the keep alive counter and when
reached instructs the server to declare the
subscription invalid.
Default: `100`.
Default: `0`.
--fd, --fetchdisplayname, --FetchOpcNodeDisplayName[=VALUE]
Fetches the displayname for the monitored items
subscribed if a display name was not specified
Expand All @@ -594,6 +596,15 @@ Subscription settings
queue size was not specified in the
configuration.
Default: `1` (for backwards compatibility).
--aq, --autosetqueuesize, --AutoSetQueueSizes[=VALUE]
(Experimental) Automatically calculate queue sizes
for monitored items using the subscription
publishing interval and the item's sampling rate
as max(configured queue size, roundup(
publishinginterval / samplinginterval)).
Note that the server might revise the queue size
down if it cannot handle the calculated size.
Default: `false` (disabled).
--ndo, --nodiscardold, --DiscardNew[=VALUE]
The publisher is using this as default value for
the discard old setting of monitored item queue
Expand Down Expand Up @@ -722,6 +733,14 @@ Subscription settings
one per writer group.
This setting overrides the `--dsg` option.
Default: `False`.
--ipi, --ignorepublishingintervals, --IgnoreConfiguredPublishingIntervals[=VALUE]
Always use the publishing interval provided via
command line argument `--op` and ignore all
publishing interval settings in the
configuration.
Combine with `--op=0` to let the server use the
lowest publishing interval it can support.
Default: `False` (disabled).

OPC UA Client configuration
---------------------------
Expand Down
44 changes: 42 additions & 2 deletions docs/opc-publisher/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,46 @@ View to browse
|**viewId** <br>*required*|Node of the view to browse <br>**Minimum length** : `1`|string|


<a name="channeldiagnosticmodel"></a>
### ChannelDiagnosticModel
Channel diagnostics model


|Name|Description|Schema|
|---|---|---|
|**channelId** <br>*optional*|The id assigned to the channel that the token<br>belongs to.|integer (int64)|
|**client** <br>*optional*||[ChannelKeyModel](definitions.md#channelkeymodel)|
|**connection** <br>*required*||[ConnectionModel](definitions.md#connectionmodel)|
|**createdAt** <br>*optional*|When the token was created by the server<br>(refers to the server's clock).|string (date-time)|
|**lifetime** <br>*optional*|The lifetime of the token|string (date-span)|
|**localIpAddress** <br>*optional*|Effective local ip address used for the connection<br>if connected. Empty if disconnected.|string|
|**localPort** <br>*optional*|The effective local port used when connected,<br>null if disconnected.|integer (int32)|
|**remoteIpAddress** <br>*optional*|Effective remote ip address used for the<br>connection if connected. Empty if disconnected.|string|
|**remotePort** <br>*optional*|The effective remote port used when connected,<br>null if disconnected.|integer (int32)|
|**server** <br>*optional*||[ChannelKeyModel](definitions.md#channelkeymodel)|
|**sessionCreated** <br>*optional*|When the session was created.|string (date-time)|
|**sessionId** <br>*optional*|The session id if connected. Empty if disconnected.|string|
|**timeStamp** <br>*required*|Timestamp of the diagnostic information|string (date-time)|
|**tokenId** <br>*optional*|The id assigned to the token.|integer (int64)|


<a name="channeldiagnosticmodeliasyncenumerable"></a>
### ChannelDiagnosticModelIAsyncEnumerable
*Type* : object


<a name="channelkeymodel"></a>
### ChannelKeyModel
Channel token key model.


|Name|Description|Schema|
|---|---|---|
|**iv** <br>*required*|Iv|< integer (int32) > array|
|**key** <br>*required*|Key|< integer (int32) > array|
|**sigLen** <br>*required*|Signature length|integer (int32)|


<a name="conditionhandlingoptionsmodel"></a>
### ConditionHandlingOptionsModel
Condition handling options model
Expand All @@ -314,8 +354,8 @@ Condition handling options model
|**updateInterval** <br>*optional*|Time interval for sending pending interval updates in seconds.|integer (int32)|


<a name="connectiondiagnosticmodeliasyncenumerable"></a>
### ConnectionDiagnosticModelIAsyncEnumerable
<a name="connectiondiagnosticsmodeliasyncenumerable"></a>
### ConnectionDiagnosticsModelIAsyncEnumerable
*Type* : object


Expand Down
Loading