Streams analysis tool and method

A streams analysis tool allows a user to define one or more buckets according to a specified tuple collection criteria for each bucket. The specified tuple collection criteria for each bucket defines some way to distinguish one data tuple from another. The specified tuple collection criteria for each bucket is therefore used to distinguish data tuples that satisfy the specified tuple collection criteria from data tuples that do not satisfy the specified tuple collection criteria. When a data tuple satisfies the specified tuple collection criteria for a bucket, the data tuple is stored in the bucket. In addition, data tuples preceding or succeeding the data tuple may also be stored in the bucket, as determined by the specified tuple collection criteria. The data tuples in each bucket are analyzed, and based on the analysis a streams manager can change how future data tuples are processed by the streaming application.

BACKGROUND

1. Technical Field

This disclosure generally relates to streaming applications, and more specifically relates to analysis of streaming applications.

2. Background Art

Streaming applications are known in the art, and typically include multiple operators coupled together in a flow graph that process streaming data in near real-time. An operator typically takes in streaming data in the form of data tuples, operates on the data tuples in some fashion, and outputs the processed data tuples to the next processing element. Streaming applications are becoming more common due to the high performance that can be achieved from near real-time processing of streaming data.

Known tools for analyzing streaming applications provide views of what is going on in the flow graph. Known views allow sampling some relatively small number of tuples to see if a streaming application is behaving as expected. For example, a view of an operator can tell a person when the operator is not processing data tuples if the operator has stopped for some reason. However, sampling some small number of data tuples may not allow for seeing data tuples related to transient events that can cause problems when potentially hundreds of thousands or millions of data tuples are being processed by a streaming application.

BRIEF SUMMARY

A streams analysis tool allows a user to define one or more buckets according to a specified tuple collection criteria for each bucket. The specified tuple collection criteria for each bucket defines some way to distinguish one data tuple from another. The specified tuple collection criteria for each bucket is therefore used to distinguish data tuples that satisfy the specified tuple collection criteria from data tuples that do not satisfy the specified tuple collection criteria. When a data tuple satisfies the specified tuple collection criteria for a bucket, the data tuple is stored in the bucket. In addition, data tuples preceding or succeeding the data tuple may also be stored in the bucket, as determined by the specified tuple collection criteria. The data tuples in each bucket are analyzed, and based on the analysis a streams manager can change how future data tuples are processed by the streaming application.

DETAILED DESCRIPTION

The disclosure and claims herein are directed to a streams analysis tool that allows a user to define one or more buckets according to a specified tuple collection criteria for each bucket. The specified tuple collection criteria for each bucket defines some way to distinguish one data tuple from another. The specified tuple collection criteria for each bucket is therefore used to distinguish data tuples that satisfy the specified tuple collection criteria from data tuples that do not satisfy the specified tuple collection criteria. When a data tuple satisfies the specified tuple collection criteria for a bucket, the data tuple is stored in the bucket. In addition, data tuples preceding or succeeding the data tuple may also be stored in the bucket, as determined by the specified tuple collection criteria. The data tuples in each bucket are analyzed, and based on the analysis a streams manager can change how future data tuples are processed by the streaming application.

Referring toFIG. 1, a computer system100is one suitable implementation of a server computer system that includes a streams analysis tool as described in more detail below. Server computer system100is an IBM POWER8 computer system. However, those skilled in the art will appreciate that the disclosure herein applies equally to any computer system, regardless of whether the computer system is a complicated multi-user computing apparatus, a single user workstation, a laptop computer system, a tablet computer, a phone, or an embedded control system. As shown inFIG. 1, computer system100comprises one or more processors110, a main memory120, a mass storage interface130, a display interface140, and a network interface150. These system components are interconnected through the use of a system bus160. Mass storage interface130is used to connect mass storage devices, such as local mass storage device155, to computer system100. One specific type of local mass storage device155is a readable and writable CD-RW drive, which may store data to and read data from a CD-RW195. Another suitable type of local mass storage device155is a card reader that receives a removable memory card, such as an SD card, and performs reads and writes to the removable memory. Yet another suitable type of local mass storage device155is a thumb drive.

Main memory120preferably contains data121, an operating system122, a streams manager123, and a streams analysis tool126. Data121represents any data that serves as input to or output from any program in computer system100. Operating system122is a multitasking operating system, such as AIX or LINUX. The streams manager123is software that provides a run-time environment that executes a streaming application124. The streaming application124preferably comprises a flow graph that includes processing elements that include operators125that process data tuples, as is known in the art.

The streams analysis tool126is software that provides a way to analyze the streaming application124. Streams analysis tool126includes buckets127, tuple collection criteria128, tuple analyzer129, and feedback tool131. Buckets127are preferably defined by a user. Each bucket has one or more corresponding tuple collection criteria128that defines which tuples are stored in the bucket. Tuple collection criteria128specifies any suitable criteria that can be used to distinguish data tuples from each other. Referring toFIG. 2, examples of items that could be included in tuple collection criteria128include data values and/or ranges210, metadata values and/or ranges220, time period230, and events240. All data tuples include data and metadata. Metadata can include any suitable information about the data tuple. Examples of metadata for a data tuple include a history of where the data tuple came from, such as a series of operators or machines; a timestamp of when the data tuple was last changed and by which operator; the data source for where the data came from; a timestamp of when the data tuple entered the system; a total number of operators the data tuple has traversed; metrics associated with the operator, such as whether it caused exceptions in prior operators; etc. When the tuple collection criteria128for a given bucket127specifies a value or range of data210, when a data tuple has a data value that matches the value or falls within the specified range, the data tuple satisfies the value or range of data, and is therefore stored in the corresponding bucket. When the tuple collection criteria128for a given bucket127specifies a value or range of metadata220, when a data tuple has a metadata value that matches the value or falls within the specified range, the data tuple satisfies the value or range of metadata, and is therefore stored in the corresponding bucket. The time period230allows a user to specify a time period of interest. The time period could be specified, for example, using clock time, or could be specified as an offset from the time the streaming application began execution. Events240can include any suitable event that could be detected during the execution of the streaming application124. For example, in a streaming application that processes telephone calls, a dropped call could be an event240. Tuple collection criteria128may additionally specify tuples to store when the specified criteria is satisfied. Tuples to store can include the matching data tuple250, the matching data tuple plus some specified number X of preceding data tuples260, the matching data tuple plus some specified number Y of succeeding data tuples270, and the matching data tuple plus a specified number A of preceding data tuples and a specified number B of succeeding data tuples280. Note the various criteria shown by way of example inFIG. 2could use logical operators to create any suitable logical combination of items to define the tuple collection criteria128. For example, a data range210could be specified logically ANDed with a time period230, which means that only tuples that have the specified data within the data range210during time period230will be stored in the corresponding bucket.

Referring back toFIG. 1, the streams analysis tool126includes a tuple analyzer129. The tuple analyzer129can be used to analyze tuples in one or more of the buckets127to determine performance and behavior of the streaming application124. The tuple analyzer129can present to a user individual tuple values, and can additionally provide trends or any other suitable information that can be derived or otherwise determined from data tuples in the buckets. Streams analysis tool126also includes a feedback tool131. Based on the analysis performed by the tuple analyzer129, the feedback tool131can communicate with the streams manager123regarding possible changes to the streaming application124for processing future data tuples. For example, the feedback tool131could indicate to the streams manager123to filter certain data tuples or to prioritize the processing of certain data tuples. While the streams analysis tool126is shown inFIG. 1separate from the streams manager124, it is equally within the scope of the disclosure and claims herein to have the streams analysis tool126as part of the streams manager123.

Computer system100utilizes well known virtual addressing mechanisms that allow the programs of computer system100to behave as if they only have access to a large, contiguous address space instead of access to multiple, smaller storage entities such as main memory120and local mass storage device155. Therefore, while data121, operating system122, streams manager123and streams analysis tool126are shown to reside in main memory120, those skilled in the art will recognize that these items are not necessarily all completely contained in main memory120at the same time. It should also be noted that the term “memory” is used herein generically to refer to the entire virtual memory of computer system100, and may include the virtual memory of other computer systems coupled to computer system100.

Processor110may be constructed from one or more microprocessors and/or integrated circuits. Processor110executes program instructions stored in main memory120. Main memory120stores programs and data that processor110may access. When computer system100starts up, processor110initially executes the program instructions that make up operating system122. Processor110also executes the streams manager123, which executes the streaming application124, and executes the streams analysis tool126.

Although computer system100is shown to contain only a single processor and a single system bus, those skilled in the art will appreciate that a streams analysis tool as described herein may be practiced using a computer system that has multiple processors and/or multiple buses. In addition, the interfaces that are used preferably each include separate, fully programmed microprocessors that are used to off-load compute-intensive processing from processor110. However, those skilled in the art will appreciate that these functions may be performed using I/O adapters as well.

Display interface140is used to directly connect one or more displays165to computer system100. These displays165, which may be non-intelligent (i.e., dumb) terminals or fully programmable workstations, are used to provide system administrators and users the ability to communicate with computer system100. Note, however, that while display interface140is provided to support communication with one or more displays165, computer system100does not necessarily require a display165, because all needed interaction with users and other processes may occur via network interface150.

Network interface150is used to connect computer system100to other computer systems or workstations175via network170. Computer systems175represent computer systems that are connected to the computer system100via the network interface150in a computer cluster. Network interface150broadly represents any suitable way to interconnect electronic devices, regardless of whether the network170comprises present-day analog and/or digital techniques or via some networking mechanism of the future. Network interface150preferably includes a combination of hardware and software that allows communicating on the network170. Software in the network interface150preferably includes a communication manager that manages communication with other computer systems175via network170using a suitable network protocol. Many different network protocols can be used to implement a network. These protocols are specialized computer programs that allow computers to communicate across a network. TCP/IP (Transmission Control Protocol/Internet Protocol) is an example of a suitable network protocol that may be used by the communication manager within the network interface150. In one suitable implementation, the network interface150is a physical Ethernet adapter.

Referring toFIG. 3, a method300is preferably performed by a human user, such as a system administrator or a programmer who is analyzing or debugging a streaming application. Method300begins by defining tuple collection criteria for a bucket (step310). The tuple collection criteria for a bucket can include any or all of the criteria210,220,230,240and tuples to store250,260,270and280shown inFIG. 2and described above, individually or in any suitable combination of logical expression. Storage is defined for the bucket (step320). Note the storage for the bucket defined in step320could be automatically defined by the streams analyzer as a result of the user defining the tuple collection criteria in step310, or could be manually defined by the user. When there are more buckets to define (step330=YES), method300loops back to step310and continues until there are no more buckets to define (step330=NO). Method300is then done.

Once method300is used to define one or more buckets and the corresponding tuple collection criteria for each bucket, the streams analysis tool126may analyze the streaming application by performing method400inFIG. 4. The data tuples in the streaming application are analyzed (step410). When a data tuple matches the tuple collection criteria for a bucket, the tuple is stored in that bucket (step420). The tuples stored in the one or more buckets may then be analyzed (step430). Method400provides much better debugging and performance analysis capabilities than known views in known streams managers, because it captures all tuples that match specified tuple collection criteria for all defined buckets, instead of sampling a relatively small number of relevant tuples. The analysis performed in step430may be used for any suitable purpose, including to determine performance of the streaming application, to debug the streaming application, etc.

Referring toFIG. 5, method500is preferably executed by the streams analysis tool126shown inFIG. 1. The data tuples stored in one or more buckets are analyzed (step510). In response to the analysis, information is fed back to the streams manager to change how future tuples are processed by the streaming application (step520). Examples of changing how future tuples are processed including filtering of data tuples and prioritization of data tuples. An example is provided below to illustrate both filtering of data tuples and prioritization of data tuples based on the analysis of data tuples in one or more buckets. Of course, other changes to how future tuples are processed by the streaming application are also within the scope of the disclosure and claims herein.

Referring toFIG. 6, an extremely simplified streaming application600is shown for the purposes of illustrating the concepts herein. The streaming application600includes ten operators A, B, C, D, E, F, G, H, I and J. Operator A produces data tuples that are sent to operator B. Operator B operates on the data tuples received from operator A and sends the resulting data tuples to operator C. Operator C operates on the data tuples received from operator B and sends the resulting data tuples to operator D. In similar fashion, operator E produces data tuples that are sent to operator F, which processes those data tuples and sends resulting data tuples to operator G. Operators D and G both send their data tuples to operator H, which processes these data tuples and sends some data tuples to operator I and other data tuples to operator J. We assume for this simple example that streaming application600processes streaming data for internet protocol (IP) telephone calls.

FIG. 7shows buckets defined by a user for the streaming application600inFIG. 6. We assume the user is debugging the streaming application600, and has found the streaming application600sometimes does not act as expected when a phone call comes in from a particular telephone number. We assume the user has defined three buckets shown inFIG. 7, which include Bucket 1, Bucket 2 and Bucket 3. Each bucket has corresponding tuple collection criteria, shown below each bucket. Thus, Bucket 1 is for data tuples that have a phone number with a value of 555-123-4567, and the specified criteria specifies to store ten tuples before and five tuples after each matching tuple. This means when a data tuple matches the specified phone number, a total of sixteen tuples are stored in Bucket 1.

We assume the problem with calls from the particular telephone number is most prevalent when a call from that telephone number is received between 1:00 AM and 4:00 AM. The user has thus defined Bucket 2 with the same phone number logically ANDed with a time range of 1:00 AM to 4:00 AM, and has specified to store 20 tuples before and 10 tuples after. We assume the problem the user is looking for is a dropped call from this phone number. The user defines Bucket 3 with tuple collection criteria that includes the phone number logically ANDed with the event of a dropped call, and to store 50 tuples before and 25 tuples after. Note that each of the buckets inFIG. 7will contain different sets of data tuples that can help the user determine a cause of the problem in the streaming application. As the streaming application600runs, the streams analysis tool analyzes each data tuple to see if it satisfies any of the tuple collection criteria for Bucket 1, Bucket 2 and Bucket 3. Let's assume a phone call comes in a 11:24 PM from 555-123-4567. For each data tuple that includes this phone number, the matching data tuples and the 10 preceding data tuples and the 5 succeeding data tuples are stored in Bucket 1. This data tuple is not stored in Bucket 2 because the time of 11:24 PM in the data tuple does not match the time period of 1:00 AM to 4:00 AM specified in the tuple collection criteria for Bucket 2. Should the call from this phone number be dropped, the 50 tuples before the call drops and the 25 tuples after are stored in Bucket 3. This simple example shows how data tuples can be stored in different buckets as a streaming application runs according to specified tuple collection criteria for each bucket.

Note that buckets as shown inFIG. 7can be defined at any suitable level of granularity according to the needs of the user. Thus, buckets could be defined for a single operator, for a group of operators, or for the entire streaming application.

In addition to analyzing the data tuples in the buckets inFIG. 7, the information gleaned from the analysis can be fed back into the streaming application to change how the streaming application processes future data tuples. For example, let's assume a data tuple with this specified phone number that is processed by operators A, B and C is always dropped by the time it is processed by operator D. The streaming application can program Operator C in the flow graph to filter out (or discard) all data tuples with the specified phone number, as shown inFIG. 8. Another example of feeding back information from the analysis of the data tuples in one or more buckets is the application can prioritize processing of data tuples by an operator. Referring to the streaming application inFIG. 6, let's assume operator F sometimes gets bogged down and has several data tuples build up in its input buffer. Let's further assume the specified phone number needs to be treated as a priority phone call that is processed even if phone calls of lower priority are dropped. The streams manager can program Operator F to provide priority processing of tuples with the phone number, as shown inFIG. 9. For example, let's assume Operator F has the following tuples that arrive in its input buffer for processing in the following order: T1, T2, T3, T4, T5, T6, T7, T8. We assume T2through T8are in Operator F's input buffer while Operator F processes T1. We further assume data tuple T7has the specified phone number that should be given priority. This means even though tuple T7arrived after tuples T2, T3, T4, T5and T6, Operator F will process tuple T7out of order because data tuples with the specified phone number are given priority over data tuples with other phone numbers. Note while filtering and prioritization of data tuples are examples of changes the streams manager can make to the streaming application according to the analysis of data tuples in one or more buckets, the disclosure and claims herein expressly extend to the streams manager making any suitable change to the streaming application as a result of the analysis of the data tuples in one or more buckets.

The examples provided herein are extremely simplified to illustrate the general concepts of storing data tuples in buckets according to user-defined tuple collection criteria. Most streaming applications are significantly more complex than shown in the example herein. However, one skilled in the art will appreciate the concepts disclosed and claimed herein can extend to a streaming application of any suitable level of complexity with any suitable number buckets and corresponding criteria. In addition, the terms “tuple” and “data tuple” as used herein are synonyms.

A streams analysis tool allows a user to define one or more buckets according to a specified tuple collection criteria for each bucket. The specified tuple collection criteria for each bucket defines some way to distinguish one data tuple from another. The specified tuple collection criteria for each bucket is therefore used to distinguish data tuples that satisfy the specified tuple collection criteria from data tuples that do not satisfy the specified tuple collection criteria. When a data tuple satisfies the specified tuple collection criteria for a bucket, the data tuple is stored in the bucket. In addition, data tuples preceding or succeeding the data tuple may also be stored in the bucket, as determined by the specified tuple collection criteria. The data tuples in each bucket are analyzed, and based on the analysis a streams manager can change how future data tuples are processed by the streaming application.