Contents
This sample contains two StreamBase applications that demonstrate the use of the TIBCO Streaming Monitor Adapter.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select >.
-
Enter
monitorto narrow the list of options. -
Select StreamBase Monitor Input Adapter From the StreamBase Standard Adapters category.
-
Click .
StreamBase Studio creates a project folder for this sample.
-
In the Project Explorer view, open the sample you just loaded.
If you see red marks on a project folder, wait a moment for the project to load its features.
If the red marks do not resolve themselves after a minute, select the project, right-click, and select > from the context menu.
-
Open the
src/main/eventflow/folder.packageName -
Open the
SBMonitorAdapter.sbappfile and click the
Run button. This opens the SB Test/Debug perspective and starts the
module.
-
In the Output Streams view, select All Output Streams to view the adapter output. Observe a burst of output once per second, describing all performance information for the server instance hosting this application.
-
Try selecting a single stream such as
SystemInfofrom the dropdown in the Output Streams view. ForSystemInfo, notice that thetimeRunningfield increases by one every second, and that the memory statistics such astotalMemoryandfreeMemorychange slightly as the application runs. -
When done, press F9 or click the
Terminate EventFlow Fragment button.
-
Continuing with the same sample project, open the
SBMonitorServer.sbappfile and click the
Run button. This opens the SB Test/Debug perspective and starts the
module.
-
In the Output Streams view, select All Output Streams to view the adapter output. Unlike the simple
SBMonitorAdapterapplication, in this case, the output from the adapter is filtered to emit only events of interest. For example, the Thread information (port #4) is connected to filterIsThreadBusy, which drops everything except threads using high amounts of CPU. -
In the EventFlow Editor for
SBMonitorServer.sbapp, select the Parameters tab. These parameters are used by the various filters to determine whether to pass an interesting event. Try changingThreadCPUThresholdMSto 5 and restarting the server.In the Output Streams view, notice that the
ThreadBusyoutput stream is now printing alerts for threads that use more than 5 milliseconds every sampling period. -
When done, press F9 or click the
Terminate EventFlow Fragment button.
The sample includes the following EventFlow applications:
-
src/main/eventflow/com.sample.adapter.sbmonitor/SBMonitorAdapter.sbappcontains a single TIBCO Streaming Monitor adapter with all of its output ports enabled. Start this application to see the monitor data for the server instance running the application itself. -
src/main/eventflow/com.sample.adapter.sbmonitor/SBMonitorServer.sbappcan run in its own StreamBase Server instance and connect remotely to another server, or can be added to a new container in a server with a running application. It will emit tuples only when certain performance thresholds are passed. For example, if any operator uses more than 0.3 seconds of CPU time in a one-second cycle sample, all information about that operator is emitted on theOperatorBusyoutput stream.
When you load the sample into StreamBase® Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.
Important
Load this sample in StreamBase® Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.
Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:
studio-workspace/sample_adapter_embedded_sbmonitorSee Default Installation Directories for the default location of studio-workspace on your system.
