Skip to content

Commit

Permalink
Changes done for v1.1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
nysenthil committed Jan 30, 2023
1 parent 5624d62 commit dfb1b9c
Show file tree
Hide file tree
Showing 13 changed files with 1,047 additions and 107 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The streamsx.websocket toolkit provides the following C++ and Java operators tha

If you clone this toolkit from the IBMStreams GitHub, then you must build this toolkit via `ant all` and `ant download-clean` from this toolkit's top-level directory. If there is no direct Internet access from the IBM Streams machine and if there is a need to go through a proxy server, then the `ant all` command may not work. In that case, you can try this command instead. `ant all -Dwebsocket.archive=file://localhost$(pwd)/ext -Dwebsocket.version=0.8.2 -Dboost.archive.src0=file://localhost$(pwd)/ext/boost-install-files/boost_1_73_0.tar.gz`

In a Streams application, these operators can either be used together or independent of each other.
In a Streams application, these operators can either be used together or independent of each other. When they are used in an IBM Streams application, the WebSocket operators in this toolkit generate important metrics data that can be viewed from the IBM Streams web console to observe details such as data transfer time, payload size, number of data items transferred etc.

## Documentation
1. The official toolkit documentation with extensive learning and operational details is available at this URL:
Expand Down
7 changes: 7 additions & 0 deletions com.ibm.streamsx.websocket/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Changes
=======
## v1.1.1:
* Jan/29/2023
* Fixed a major network performance impact in the ws_data_sender method of all the three WebSocket operators by changing it from a long running thread loop method into a non-thread one shot callable method that can send the text and/or binary data item via active WebSocket connection(s) and return back to the caller immediately after that..
* Added a new tcpNoDelay parameter and a low level socket init handler to all the three WebSocket operators so that the user can turn on or off TCP_NODELAY to control Nagle's algorithm. This new feature will work only with a websocketpp library version 0.8.3 and higher.
* Added a few more metrics for the three WebSocket operators to view send and receive performance numbers in terms of data transfer time and payload size.
* Enhanced the operator documentation with more details about the above-mentioned changes.

## v1.1.0:
* Nov/19/2021
* Fixed a problem in the HttpPost operator where the HTTP GET query string not getting sent to the remote server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
this operator is still active, any incoming tuple into this operator at that time
will not be sent to the remote server at all. In this case, the application logic
invoking this operator can retransmit that tuple at a later time just because
this operator will keep trying to restablish the connection behind the scenes.
this operator will keep trying to reestablish the connection behind the scenes.
It is a good practice for the application logic to backoff and wait for a
reasonable amount of time when there is a connection error with the
remote WebSocket server before inputting a tuple again into this operator.
Otherwise, it will trigger too many connection attempts on every incoming
tuple to send it to the remote server. So, the application logic should make an
attempt to wait for a while before attempting to send the data after knowing that
attempt to wait for a while before deciding to send the data after knowing that
there is an ongoing connection problem with the remote server.

This operator provides one input port through which an application can send data to the
Expand All @@ -56,6 +56,12 @@
non-zero value, then the application can have additional logic to retransmit that same
data item at a later time. Please refer to the output port section below for more details.

Since WebSocket at its low level is based on TCP, you have to be aware of the
effects of the Nagle's algorithm which is usually controlled by TCP_NODELAY.
This operator has an optional parameter named tcpNoDelay to enable or disable
Nagle's algorithm for your needs. The tcpNoDelay parameter will do its job
correctly only with the websocketpp library version 0.8.3 and higher.

Requirements:
* Intel RHEL6 or RHEL7 hosts installed with IBM Streams.

Expand Down Expand Up @@ -100,6 +106,30 @@
<description>Indicates the current active status of the WebSocket connection.</description>
<kind>Gauge</kind>
</metric>

<metric>
<name>nTimeTakenToSendMostRecentDataItem</name>
<description>Time taken in milliseconds to send the most recent data item to the remote server.</description>
<kind>Gauge</kind>
</metric>

<metric>
<name>nSizeOfMostRecentDataItemSent</name>
<description>Size of the most recent data item sent to the remote server.</description>
<kind>Gauge</kind>
</metric>

<metric>
<name>nSizeOfMostRecentDataItemReceived</name>
<description>Size of the most recent data item received from the remote server.</description>
<kind>Gauge</kind>
</metric>

<metric>
<name>nTcpNoDelay</name>
<description>Did the user configure TCP_NODELAY for this operator?</description>
<kind>Gauge</kind>
</metric>
</metrics>

<customOutputFunctions>
Expand Down Expand Up @@ -274,6 +304,16 @@
<type>float64</type>
<cardinality>1</cardinality>
</parameter>

<parameter>
<name>tcpNoDelay</name>
<description>This parameter can be used to control the TCP Nagle's algorithm. Setting it to true will disable Nagle's algorithm and setting it to false will enable. (Default is false.)</description>
<optional>true</optional>
<rewriteAllowed>true</rewriteAllowed>
<expressionMode>AttributeFree</expressionMode>
<type>boolean</type>
<cardinality>1</cardinality>
</parameter>
</parameters>

<inputPorts>
Expand Down
Loading

0 comments on commit dfb1b9c

Please sign in to comment.