# Patent

## Title
System and methods for display of time-series data distribution

## Abstract

A system and methods for displaying data distribution information for time-series data is described. The methods include computing a condensed quantile function that may be used to generate approximate histograms for the time-series data, while decreasing the data storage requirements for generating a series of histograms for time-series data. The methods further include displaying the data distribution information using stack-bar histograms, many of which may be shown in a single display to permit a user to discern trends in the data distribution information. Methods for merging condensed quantile function tables are also described.

## Background
CROSS-REFERENCE TO RELATED CASES
This application claims priority to and the benefit of, and incorporates herein by reference, in its entirety, provisional U.S. patent application Ser. No. 60/322,021, filed Sep. 13, 2001. This application also incorporates herein by reference, in their entirety, U.S. patent application Ser. No. 10/186,401, filed Jul. 1, 2002, and Ser. No. 10/198,689, filed Jul. 18, 2002.


FIELD OF THE INVENTION
The invention relates to a system and methods for monitoring a set of metrics. More particularly, the invention provides a system and methods for computing and displaying data distribution information for metrics.
BACKGROUND OF THE INVENTION
Transactions are at the heart of e-business. Without fast, efficient transactions, orders dwindle and profits diminish. Today's e-business technology, for example, is providing businesses of all types with the ability to redefine transactions. There is a need, though, to optimize transaction performance and this requires the monitoring, careful analysis and management of transactions and other system performance metrics that may affect e-business.
Due to the complexity of modern e-business systems, it may be necessary to monitor thousands of performance metrics, ranging from relatively high-level metrics, such as transaction response time, throughput and availability, to low-level metrics, such as the amount of physical memory in use on each computer on a network, the amount of disk space available, or the number of threads executing on each processor on each computer. Metrics relating to the operation of database systems, operating systems, physical hardware, network performance, etc., all must be monitored, across networks that may include many computers, each executing numerous processes, so that problems can be detected and corrected when (or preferably before) they arise.
Due to the complexity of the problem and the number of metrics involved, it is useful to be able to quickly view information relating to one or more metrics across a period of time. In particular, viewing information on the frequency distribution of data may be useful. Such data distribution information generally may be viewed as a histogram, and many systems that perform statistical analysis are able to display histograms.
Unfortunately, there are a number of drawbacks to using conventional histograms to view time series data, such as the complex metrics discussed above. First, there is often a need to display multiple histograms on a screen when working with time series data, such as metrics. Each histogram typically requires a large amount of screen space, limiting the number of histograms that can be displayed at the same time.
Additionally, histograms are not always useful for discovering trends in data over time, since it may be difficult to see long-term trends in data by viewing a set of standard histograms side-by-side or stacked vertically. Some systems attempt to solve this problem by making the histograms small, and turning them on their side. Unfortunately, even when these steps are taken, it may be difficult to display more than five or six histograms on a single display. It would be impractical in such systems to display fifty or a hundred such histograms in a single display.
Another difficulty with using histograms to view data distribution information over a long period of time is the storage of histogram data. Typically, a large number of individual data samples are needed to construct a histogram. To display histograms for data over a long time period, there are two options available. First, a system can pre-compute the histogram for each required time interval, and save the histogram data. This approach requires many computations and storage of data that may never be used. Alternatively, a system can save all the individual data points over a long time period, so that histograms can be computed as they are needed. This approach requires a large amount of storage, and may require a large memory footprint and a large amount of computation when the histograms are generated. As a result, this approach may not be practical for long periods of time and large numbers of metrics.
Additionally, histograms are somewhat inflexible. For example, they cannot be effectively averaged or merged to condense the display of several time intervals into a single interval. Similarly, they cannot be effectively averaged or merged from multiple copies of the same metric collected from distinct but similar systems. Such data distribution information may be useful for viewing the health and status of an entire system using only a few displays or screens.
SUMMARY OF THE INVENTION
In view of the foregoing, there is a need for a system and methods for computing and displaying data distribution information for large sets of time-series data, such as metrics. Further, there is a need for a system and methods for efficiently storing, and merging such data distribution information.
In one aspect, the present invention provides a method for generating an approximate histogram of a data set. This is done by applying a quantile function on the data set to create a computational result, selecting a subset of the data set in response to the computational result, determining a condensed quantile function from the subset of the data set, and rendering the approximate histogram in response to the condensed quantile function.
In some embodiments, the subset of the data set includes at least one of a minimum value of the data set, a median value of the data set, and a maximum value of the data set.
In some embodiments, determining the condensed quantile function involves interpolating between values in the data set. In some such embodiments, the interpolation includes at least one of linear interpolation and polynomial interpolation.
In some embodiments, rendering the approximate histogram involves calculating an expected sample count based at least in part on an inverse of the condensed quantile function.
In some embodiments, the approximate histogram includes a plurality of bins. In these embodiments, the rendering step includes reducing the plurality of bins in the approximate histogram into a plurality of adjacent cells, and applying an indicium to each cell in response to the percentage of the data set within each cell. In some such embodiments, the indicium is visually discernable (e.g., a shade, texture, or color of the cell).
In another aspect, the invention provides a method of merging a plurality of data sets with reduced data storage requirements. This is accomplished by calculating a condensed quantile function for each data set, with each condensed quantile function supplying quantile values. Next, the quantile values are interleaved, and an inverse of each condensed quantile function is calculated at each interleaved quantile value. The average of the inverse of the condensed quantile functions at each interleaved quantile value are calculated, and a merged quantile function is defined as an inverse of the average of the inverse of the condensed quantile functions at each interleaved quantile value.
In some embodiments the plurality of data sets include data associated with a single variable from adjacent time intervals. In other embodiments, the plurality of data sets include data associated with a plurality of instances of a single variable from a single time interval.
Some embodiments further include a step of rendering a merged histogram in response to the merged quantile function. In some of these embodiments, rendering the merged histogram involves calculating an expected sample count based at least in part on an inverse of the merged quantile function. In some embodiments, the step of rendering the merged histogram includes reducing a plurality of bins in the merged histogram into a plurality of adjacent cells, and applying an indicium to each cell in response to a percentage of the data set within each cell. In some such embodiments, the indicium is visually discernable.
In a further aspect, the invention provides a method of optimizing performance in a distributed transaction system. This is accomplished by collecting data associated with at least one system performance metric, and applying a quantile function on the data to create a computational result. Next, a subset of the data is selected in response to the computational result, and a condensed quantile function is determined from the subset of the data. The method also includes rendering at least one approximate histogram in response to the condensed quantile function, identifying at least one trend in the approximate histogram, and adjusting, on an as-needed basis, operation of the distributed transaction system to modify the trend.
In some embodiments, the methods of the invention can be implemented in software, or in logic or other hardware. When the methods are implemented in software, the software may be made available to developers and end users online and through download vehicles. It may also be embodied in an article of manufacture that includes a program storage medium such as a computer disk or diskette, a CD, DVD, or computer memory device.
Other aspects, embodiments, and advantages of the present invention will become apparent from the following detailed description which, taken in conjunction with the accompanying drawings, illustrating the principles of the invention by way of example only.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing and other objects, features, and advantages of the present invention, as well as the invention itself, will be more fully understood from the following description of various embodiments, when read together with the accompanying drawings, in which:
FIG. 1 shows an example of a system that may be monitored using the system and methods of the invention;
FIG. 2 is a block diagram showing a high-level overview of an embodiment of the system and methods of the invention;
FIGS. 3A–3B show example plots of data points to be analyzed according to an embodiment of the invention;
FIG. 4 shows an example histogram of the data points of FIG. 3B;
FIG. 5 shows an example estimated probability density function for the data shown in FIG. 3B;
FIG. 6 shows an example of a normalized estimated probability density function;
FIG. 7 shows an example of an estimated cumulative distribution function;
FIG. 8 shows an example quantile function estimated from the example data shown in FIG. 3B;
FIG. 9 shows an example of a condensed estimated quantile function;
FIG. 10 shows an example of an approximate histogram that has been reconstructed from the condensed estimated quantile function of FIG. 9 according to an embodiment of the invention;
FIG. 11 shows an example histogram of a full set of data points, for comparison with the estimated histogram of FIG. 10;
FIG. 12 is a block diagram of a method for generating an approximate histogram in accordance with an embodiment of the invention;
FIG. 13 is a flowchart of an adaptive fit algorithm that may be used according to an embodiment of the invention to choose the points for a condensed quantile tables;
FIG. 14 illustrates the rendering of the data of an approximate histogram as a stack-bar histogram, in accordance with an embodiment of the invention;
FIG. 15 shows numerous stack-bar histograms arranged in a single display, in accordance with an embodiment of the invention;
FIG. 16 shows a time-series of stack-bar histograms with the data from which the stack-bar histograms were generated overlaid, to verify the accuracy of stack-bar histograms;
FIG. 17 shows a display of an example embodiment of a monitoring system that uses stack-bar histograms, according to an embodiment of the present invention;
FIG. 18 is an example showing a merged sample quantile function, as well as quantile functions of two original data sets, and of the joined data from the two original data sets according to an embodiment of the invention;
FIG. 19 shows an example in which stack bar histograms are merged to form a new stack-bar histogram according to an embodiment of the invention;
FIG. 20 shows a merged stack-bar histogram chart with data points overlaid, to verify the accuracy of the merged stack-bar histogram chart; and
FIG. 21 is a flowchart of an algorithm for merging quantile functions according to an embodiment of the invention.



In the drawings, like reference characters generally refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed on illustrating the principles of the invention.
DETAILED DESCRIPTION OF THE INVENTION
As shown in the drawings for the purposes of illustration, the invention may be embodied in a system that collects, analyzes, and reports performance metrics for systems such as, for example, complex transaction-based structures typified by (but not limited to) e-commerce systems. In broad overview, the invention relates to the monitoring of a set of system performance metrics, such as transaction response time, throughput, availability, etc. The system receives metric data and generates and displays a set of “approximate histograms” from the quantile function of a time series segment. An approximate histogram is an estimation of the histogram of an original (i.e., complete) data set.
In addition to generating “approximate histograms,” an embodiment of the invention also displays a set of histograms for successive time intervals using a set of offset stacked bar charts. The resulting display provides a useful visual tool for tracking changes in the central values of a metric and for detecting subtle changes in its frequency distribution over long time scales. Due to the use of approximate histograms, this is accomplished without the need to store a large number of individual samples over long periods of time.
Based on the data monitored and displayed, an end user is able to identify trends and other indicia (e.g., threshold alarm notification) of system performance. The information displayed (e.g., response time, throughput, and availability) can indicate that certain transactions are not occurring as expected. Consequently, an end user is able to act to determine and remedy the root cause of transaction problems before they become critical.
The system and methods of the present invention are described herein as applying to software for use by a system manager, such as an e-business system manager, to assist, for example, in the achievement and maintenance of Service Level Agreements in terms of system performance. It will be understood that the system and methods of the present invention are not limited to this application, and can be applied to the storage and display of histogram data in most any system whose operation can be described through use of a set of system metrics.
FIG. 1 shows an example of a system 100 that may be monitored using the system and methods of the present invention. Various system metrics are collected on one or more of monitored systems 102, 104, and 106. These metrics are then sent via a network or other communications means to analysis system 108. On analysis system 108, the metrics are analyzed and displayed in accordance with the system and methods of the invention.
In FIG. 2, a high-level overview of the system 200 of the present invention is shown. Data collection module 202 collects metric data from numerous sources, and makes the metric data available to approximate histogram generation module 204. It will be understood that data collection module 202 may be a part of a larger metric collection and analysis system, and that generally, the system and methods of the invention may be built in to such a collection and analysis system. Alternatively, the system and methods of the invention may be implemented in software that interoperates with a metric data collection and analysis system, without being integrated into the metric data collection and analysis system.
Approximate histogram generation module 204 uses the methods detailed below to generate approximate histograms for the data. Using these techniques, it is possible to store histogram data over a long period of time without requiring large amounts of storage space. As will be described in detail below, this is done by generating and storing condensed quantile tables, from which approximate histograms for the data may be generated. Approximate histogram generation module 204 is able to aggregate histogram data by merging the condensed quantile tables.
Histogram display module 206 displays histogram data as “stack-bar” histograms, which will be described in detail below. Use of these stack-bar histograms permits multiple histograms to be displayed at once without requiring a large amount of screen space. Additionally scaled stack-bar histograms can be displayed for multiple time intervals, permitting an operator to view trends in the histogram data associated with a metric.
In operation, data collection module 202 collects N Data points for a metric over each time interval T. For example, N may be 900 points over a T=15 minute interval. FIG. 3A shows an example plot of data points for 18 intervals where N=180 and T=30. Vertical lines mark the borders of each 30-minute time interval in FIG. 3A. FIG. 3B shows an expanded view of the 180 data points in time interval 302, which is highlighted in FIG. 3A. The data shown in FIGS. 3A and 3B will be used throughout the following examples.
Once the data is collected, it is processed by an approximate histogram generation module, as described below.
Generating an Approximate Histogram
This section presents a method for generating an approximate histogram from the quantile function of a condensed data set. This is useful as a data compression technique because a small number of data points from the quantile function can retain much information about the distribution of a data set. As will be described, a histogram can be re-constructed from the condensed quantile points. Such a re-constructed histogram is referred to as an approximate histogram.
In general, four basic functions are involved in generating the approximate histogram: the histogram, the probability density function, the cumulative distribution function and the quantile function. The relationship between these functions provides a basis for the method, as described below.
FIG. 4 shows a histogram 400 of the data points shown in FIG. 3B. Generally, a histogram is a plot of the frequency distribution of values within a given range. The histogram 400 is divided into bins of equal width. The height of each bin represents the number of point values that fall between the minimum and maximum limits for that bin. Generating such a histogram is typically accomplished by determining the number of bins, determining the minimum and maximum limits for each bin, and determining which bin each data point would be in, based on the minimum and maximum limits.
Typically, all of the data points are needed to regenerate the histogram 400. Thus, unless histograms are pre-computed and saved, a large amount of data must be stored to produce a histogram on demand.
Referring now to FIG. 5, an estimated Probability Density Function (PDF) 500 for the data of FIG. 3B is shown, superimposed on the histogram 400. The PDF 500 is a function representing the probability, expressed as p=f(v), that a value will fall close to v. The PDF 500 can be estimated by constructing a smooth curve that passes through the top of the histogram bins. The distribution of the data in this example does not follow either a Gaussian distribution or any other simple mathematical form. FIG. 6 shows the normalized estimated PDF 600, scaled so that the total area under the curve equals 1.0. A possible polynomial fit for the estimated PDF 600 is:

f(v)=0.000058556v9−0.00353074v8+0.14075v7−3.89408v6+76.2797v5−1057.71v4+10172.4v3−64611.8v2+243906.0v−414515

FIG. 7 shows the estimated cumulative distribution function (CDF) 700 of the example data. The CDF 700, F(v), gives the probability that a sample random variable vi will be less than the given value v. Alternatively, F(v) can be viewed as the portion of a large sample set of the random variable x that will be less than v. Generally, the CDF 700 is computed as the integral of the PDF:




  
    
      
        
          F
          ⁡
          
            (
            v
            )
          
        
        =
        
          
            P
            ⁡
            
              (
              
                x
                ≤
                v
              
              )
            
          
          =
          
            
              ∫
              
                -
                ∞
              
              v
            
            ⁢
            
              
                f
                ⁡
                
                  (
                  x
                  )
                
              
              ⁢
              
                d
                x
              
            
          
        
      
    
    
      
        (
        
          Eq
          .
          
            
          
          ⁢
          1
        
        )
      
    
  




    
    
        A possible resulting polynomial for the CDF 700 is:

F(v)=5.8556×10−6v10−0.000392304v9+0.0175938v8−0.556297v7+12.7133v6−211.542v5+2543.09v4−21537.3v3+121953v2−414515v 

    
    


Note that an estimated histogram of the underlying data can be generated from the CDF. The probability that a value will fall between a lower bin limit, vl, and an upper bin limit, vh, may be computed using the CDF, F(v), as follows:

P(vl<v≦vh)=F(vh)−F(vl)  (Eq. 2)

    
    
        Where:
        
            F(v) is the CDF;
            vh is the upper bin limit; and
            vl is the lower bin limit.
        
        
    
    


Thus, the expected value of the number of samples that will fall in a bin, j, is:

Nj=N*(F(vhj)−F(vlj))  (Eq. 3)

    
    
        Where:
        
            Nj is the expected number of samples in the jth bin;
            N is the total number of data points;
            F(v) is the CDF;
            vhj is the upper bin limit for the jth bin; and
            vlj is the lower bin limit for the jth bin.
        
        
    
    


FIG. 8 shows the quantile function 800 estimated from the example data of FIG. 3B. Generally, a quantile function, such as that shown in FIG. 8 can model any arbitrary distribution. The quantile function maps a probability p, to a value v, such that p is the probability that a value vk taken from a similar data set will be less than v. The quantile function Q is the inverse of the CDF. That is:

v=Q(p)v such that P(vk≦v)=p. 

Q(p)=F−1(p)  (Eq. 4)

A condensed quantile function may be generated by selecting a subset of the data points from the quantile function. For example, 13 points may be selected from the complete data set, including the minimum, median and maximum values. For the quantile function 800 of FIG. 8, the values might be:












P
V








Min
12.9587



0.05
13.6785


0.15
14.2774


0.25
14.5957


0.35
15.0723


0.45
15.4357


0.50
15.6944
Median


0.55
15.9530


0.65
17.2503


0.75
23.4571


0.85
24.4150


0.95
25.8885


Max
28.5020









    
    
        Where P is an estimate of the probability that a randomly chosen value (vk) will be less than the value V.
    
    


FIG. 9 shows a condensed estimated quantile function 900 plotted from the 13 quantile points shown above. The shape of the condensed quantile function shown in FIG. 9 is close to the shape of the quantile function shown in FIG. 8, which was based on the full 180 data points.
As discussed above, an estimated histogram may be generated from a CDF, which is the inverse of the quantile function. Thus, an approximate histogram may be generated based on the inverse of the condensed estimated quantile function. FIG. 10 shows a histogram 1000 that has been reconstructed from the condensed estimated quantile function of FIG. 9. For this example, the histogram bin limits are equally spaced between the 5% and 95% quantile points.
FIG. 11 shows a similar histogram 1100 (with bins equally spaced between the 5% and 95% quantile points) for the full set of data points. As can be seen, the shape of the reconstructed histogram 1000 of FIG. 10 is similar to the shape of the histogram 1100 based on the original data, shown in FIG. 11. This confirms the value of this reconstruction technique, and demonstrates that, in accordance with the invention, a reasonable approximate histogram may be generated from relatively few points of a condensed estimated CDF.
Note that the histogram 1100 in FIG. 11 has a different appearance than the histogram 400 in FIG. 4, even though they are based on the same data. This is because the 16 bin limits in FIG. 4 are evenly spaced between the minimum and maximum values whereas the 8 bin limits in FIG. 11 are evenly spaced between the 5% and 95% quantile points for comparison with the reconstructed approximate histogram 1000 shown in FIG. 10.
Use of a condensed estimated quantile function, as discussed above, can provide numerous benefits. First, because far fewer points are needed to generate histograms from condensed estimated quantile functions than from the original data, the amount of memory and the number of calculations that are needed to produce histograms are greatly reduced. Because of the reduced number of calculations that are needed, it is possible to quickly compute numerous histograms, representing large amounts of data. Additionally, use of condensed estimated quantile functions can provide substantial savings of storage space. For example, to store 24 hours of raw, one-second samples would require 24 hr.×3600 sec./hr., or 86,400 storage locations. In contrast, the storage of 96 condensed quantile functions of thirteen points each, providing one such quantile function for each fifteen minute interval, would requires only 96×13=1248 storage locations.
The functions outlined in the above example provide the basis for generating an approximate histogram. As will be shown below, in an embodiment of the invention, the process is implemented in an efficient manner, in which a quantile function is directly estimated from the data.
Referring to FIG. 12, a high-level block diagram of a method 1200 for generating an approximate histogram is shown. First, in step 1202, an estimated quantile function for the data is generated from the individual samples in a time interval. Next, in step 1204, a condensed quantile table is produced from the estimated quantile function by choosing a relatively small number of points from the estimated quantile function. At this stage, the condensed quantile table may be stored in the quantile table store 1250, which may be a file, a database, or any other form of storage. Next, in step 1206, a condensed quantile table, which optionally may be read from quantile table store 1250, is used to generate an approximate histogram. Each of these steps will be detailed below.
At step 1202, the system generates an estimated quantile function from the samples of a time interval. In general, the estimated quantile function associates a value (v), with the portion (p) of all values that are less than v. The portion (p) is an estimate of the probability that a randomly chosen value (vk) will be less than the value (v). The quantile function takes the probability or portion (p) as input and returns the value (v).

v=Q(P)v such that P(vk≦v)=p. 

Given a set of N values (i.e., N samples from a time interval), the estimated quantile function may be constructed, for example, by sorting the set of values (vi) into ascending order. This may be done incrementally as the data is collected using, for example, an insertion sort. If the data is already available it may be sorted efficiently with any number of standard techniques including Quicksort or with a merge sort, depending on the sorting performance and stability sought.
Next, for each sorted value vi (where i is in the range 0 to N−1), a pseudo-probability pi is assigned as follows:

pi=(i+0.5)/N  (Eq. 5)

    
    
        Where:
        
            i=the index (0 to N−1) of the sample in the sorted list; and
            N=the total number of values
        
        
    
    


This process will produce a set of N (pi, vi) pairs, where the pi values are evenly spaced. These (pi, vi) pairs form an estimated quantile function for the data.
In step 1204, to reduce storage requirements, in accordance with and embodiment of the invention, only some of the sample quantile function points are stored as a condensed quantile table. To maintain the maximum amount of information, these points, or sub-samples could be more closely spaced where the quantile function has high curvature, and farther apart where there is less curvature. An algorithm to select such sub-samples will be described in detail below, with reference to FIG. 13.
A strategy for selecting sub-samples that will work for many applications is to evenly space the sub-samples. This also eliminates the need to store the probabilities, since they are implicit (i.e., they are evenly spaced).
Given N samples, M evenly spaced sub-samples, psk may be chosen. For suitable values of N and M, the indices of the sub-samples may be chosen as follows:




  
    
      
        dp
        =
        
        ⁢
        
          1
          /
          
            (
            
              M
              -
              1
            
            )
          
        
      
    
  
  
    
      
        
          ps
          0
        
        =
        
        ⁢
        
          dp
          /
          2
        
      
    
  
  
    
      
        
          ps
          
            j
            +
            1
          
        
        =
        
        ⁢
        
          
            ps
            j
          
          +
          dp
        
      
    
  
  
    
      
        
          vs
          j
        
        =
        
        ⁢
        
          Q
          ⁡
          
            (
            
              ps
              j
            
            )
          
        
      
    
  




    
    
        Where:
        
            dp=the change in the sub-sample probability for each of the (evenly spaced) psj;
            ps0=the first sub-sample probability;
        
        
        psj=the sub-sample probabilities, where j=0 to M−1; and
        vsj=the sub-sample quantile values, where j=0 to M−1.
    
    


To ensure that the median is captured when M is odd, the value of the middle quantile point may be set to Q(0.5). When M is odd, the middle index is (M−1)/2.
In general, the sub-sample probabilities (psk) will not correspond to the original sample probabilities (pi). For example if ps equals 0.5 and there are an even number of samples N, then Q(0.5) will be the average of sample vN/2−1 and vN/2. So Q(ps) must be calculated by interpolation for any (ps) that falls between two points in the estimated quantile function table.
As an example, let N=900 and M=11, then the probabilities and corresponding quantile points that make up the condensed quantile table would be as follows:



















ps0 =
0.05
vs0 =
Q(0.05)




ps1 =
0.15
vs1 =
Q(0.15)



ps2 =
0.25
vs2 =
Q(0.25)



ps3 =
0.35
vs3 =
Q(0.35)



ps4 =
0.45
vs4 =
Q(0.45)



ps5 =
0.50
vs5 =
Q(0.50)
Median



ps6 =
0.55
vs6 =
Q(0.55)



ps7 =
0.65
vs7 =
Q(0.65)



ps8 =
0.75
vs8 =
Q(0.75)



ps9 =
0.85
vs9 =
Q(0.85)



ps10 =
0.95
vs10 =
Q(0.95)










The value of the quantile function Q(ps) can be calculated from the estimated quantile table (i.e., the (pi, vi) pairs) by interpolation. First, the system finds the index in the table that has the probability value closest to (ps). This can be done by inverting the pseudo probability function. Given that

pi=(i+0.5)/N 

The indices (i0,i1) that correspond to the interval containing (ps) can be found as follows:

i0=IntegerPart(ps*N−0.5)  (Eq. 6)

i1=i0+1  (Eq. 7)

The value of Q(ps) is then computed using known linear interpolation techniques to interpolate a result between vi0 and vi1. If required, polynomial interpolation could be used for higher precision.
If N is large, the difference between p0, ps and p1 will be small. For example, if N=1000, the difference between p0 and p1 will be 0.001, and ps will be within 0.0005 of either p0 or p1. This leads to an even more accurate estimate of Q(ps) when N is large.
Thus, when the number of sorted samples (N) is large, the condensed quantile table can be constructed with little loss of accuracy by choosing samples of vi corresponding to the required probabilities pi. Given that

pi=(i+0.5)/N 

the index of the value closest to Q(ps) is:

i=Round(ps*N−0.5)

    
    
        Where the Round function rounds its input up if the fractional part of the input is 0.5 or larger, or down if the fractional part of the input is less than 0.5.
    
    


Thus, when N is large, Q(ps )≈vi for all required values of ps. The probability error (ep) introduced by this method will be less than or equal to one-half of the difference between successive probabilities, i.e.:

ep<=0.5/N. 

The corresponding quantile value error introduced is less than or equal to one-half of the maximum difference between two successive values, vi, vi+1.
If the values of M and N are such that the fractional part of [pi*N−0.5] is close to 0.5, then an improvement in accuracy may be gained by averaging adjacent samples. For example, if N=900 and M=11, then the probabilities and corresponding quantile points that make up the condensed quantile table would be as follows (indices are given by equations 6 and 7):

















ps0 =
0.05
vs0 =
Q(0.05)
= (v44 + v45)/2



ps1 =
0.15
vs1 =
Q(0.15)
= (v134 + v135)/2


ps2 =
0.25
vs2 =
Q(0.25)
= (v224 + v225)/2


ps3 =
0.35
vs3 =
Q(0.35)
= (v314 + v315)/2


ps4 =
0.45
vs4 =
Q(0.45)
= (v404 + v405)/2


ps5 =
0.50
vs5 =
Q(0.50)
= (v449 + v450)/2
Median


ps6 =
0.55
vs6 =
Q(0.55)
= (v494 + v495)/2


ps7 =
0.65
vs7 =
Q(0.65)
= (v584 + v585)/2


ps8 =
0.75
vs8 =
Q(0.75)
= (v674 + v675)/2


ps9 =
0.85
vs9 =
Q(0.85)
= (v764 + v765)/2


ps10 =
0.95
vs10 =
Q(0.95)
= (v854 + v855)/2









The estimated quantile function, condensed or not condensed, represents a set of samples that are an estimate of the inverse of the Cumulative Probability Distribution Function F(v) of the underlying data set. In step 1206, as discussed above, the approximate histogram is computed. This is done by finding the inverse of the condensed estimated quantile function, which is represented by the condensed quantile table, and using the inverse (which is an approximate CDF) to produce the approximate histogram.
To estimate the number of samples that would fall in a histogram bin, the inverse of the quantile function is used, evaluated at both bin limits. (The inverse of the quantile function is the probability that a randomly chosen value Vk will be less than V.)

F(v)=Q−1(v)=P(vk≦v).

The probability that a value will fall between vl and vh is computed as follows:

P(vl<v≦vh)=Q−1(vh)−Q−1(vl)

The expected value of the number of samples to fall in the same range is:

Nj=N*(Q−1(vhj)−Q−1(vlj))

The histogram can be formed as the set of Nj computed using this formula. The set bin limits (vl, vh) are established at equal intervals over a reasonable range of values. For example, these could be from the lowest quantile point to the highest, or a certain number of inter-quantile ranges (IQR's) around the median. The resulting set of Nj will approximate the original histogram of the data set.
The inverse of the quantile function can be computed efficiently with a binary search method. This is because the quantile function is monotonic. Given a table of quantile function values (psj, vsj), and a value (v) it is possible to find Q−1(v) using the following procedure (provided as pseudocode):















Repeat until pmid converges on Q31 1(v):









While Δp > Δmin:









pmid = (pmin + pmax )/2



Δp = pmax − pmin



v′ = Q(pmid)



// note - if v′ < then Q−1(v) > Pmid, else Q−1(v) < pmid



If (v′ < v)









pmin = pmid









Else









pmax = pmid









End-if









End-while









Return pmid







Where:



v is the input value − the code computes Q−1(v);



Δmin is a constant representing the required precision (e.g., 0.00001);



pmin is the minimum probability to check (typically initialized to 0.0);



pmax is the maximum probability to check (typically initialized to 1.0);



pmid is the current estimated probability;



Δp is the change in probability (typically initialized to 1.0); and



v′ is the quantile value corresponding to pmid.



Note



When this procedure is complete, pmid contains an estimate of Q−1(v) to within Δmin.






Having computed an estimate for the CDF (i.e., Q−1(v)), the methods described above are used to determine the expected number of samples in each bin of the approximate histogram.
FIG. 13 shows a flowchart for an adaptive fit algorithm 1300, which may be used in step 1204, to choose the points for a condensed quantile table. The adaptive fit algorithm chooses subsamples from the estimated quantile table such that the subsamples are closely spaced where the quantile function has high curvature, and are spaced farther apart where there is less curvature.
Generally, the adaptive fit algorithm 1300 takes an estimated quantile table (Q), which includes a set of pairs (pi, vi), where i is from 1 to N. A goal is to generate a condensed quantile table, including a set of K pairs (psj, vsj), where j is from 1 to K, and K is much less than N. Preferably, the condensed quantile function will closely approximate Q, so that the condensed quantile table retains most of the information in the larger estimated quantile table.
In step 1302, a line is created between the first point in the quantile table and the last point, using the p and v values as x and y coordinates, respectively.
Next, in step 1304, the system computes the perpendicular distance between each quantile point and the line that was created in step 1302 (i.e., the distance between the line and the point along a linear path that runs perpendicular to the line). The line and the point that has the maximum perpendicular distance from the line are recorded in a segment list. Additionally, the “current” segment is set to this line.
In step 1306, the system creates two line segments from the “current” segment. The first of these line segments extends from the first point of the “current” segment to P, the point along the “current” segment having the maximum perpendicular distance from the “current” segment. The second segment extends from P to the last point of the “current” segment.
In step 1308, for each of the two line segments created in step 1306, the system computes the perpendicular distance between each point on that segment and the line between the first point of the segment and the last point of the segment. The system records the location of the point that has the maximum distance from the line segment.
In step 1310, the system removes the “current” segment from the segment list, and inserts in its place the two new segments, each of which consists of a line, and a most distant point.
Next, in step 1312, the system finds the segment in the segment list that has the largest maximum point distance, and makes this segment the “current” segment. The system then repeats steps 1306–1312 until the segment list has K−1 segments (step 1314).
Finally, the system generates a K point condensed quantile table by taking from the segment list the first point of the first segment, followed by the last points of the K−1 segments in the segment list, in order. As discussed above, this condensed quantile table can be used to generate an approximate histogram.
The approximate histograms that are generated by the above-described methods may be used for many of the same purposes for which a normal histogram may be used. In addition, because the amount of information needed to generate an approximate histogram is considerably less than what is needed to generate a regular histogram, and approximate histograms may be quickly generated from condensed quantile tables, use of approximate histograms may be used in instances where use of a regular histogram would be impractical.
Stack-Bar Histogram Charts
In accordance with an illustrative embodiment of the invention, approximate histograms may be used to create stack-bar histograms, which permit numerous histograms to be displayed on a single screen. The ability to display numerous histograms on a single screen permits a viewer to see trends in the data that would not have been readily ascertainable without such a display.
FIG. 14 illustrates the conversion of an approximate histogram into a stack bar histogram. The first and last bins of histogram 1402 are removed to create histogram 1404. The height of each bin in histogram 1404 determines a shade, texture, color, or other visual indicium that is applied to represent that bin. In the example shown in FIG. 14, light shades or textures generally represent a bin with fewer entries, while dark shades or textures represent a bin with many entries. The shades, textures, or colors that represent the bins are then arranged as a set of vertical cells to form stack bar histogram 1406.
Stack bar histogram 1406 represents a data distribution using shades, textures, or colors, rather than using the height of bars to show the number of items in each bin. Advantageously, since such stack bar histograms are more compact than a regular representation of a histogram, numerous such stack bar histograms may be arranged in a single display.
FIG. 15 shows numerous stack-bar histograms arranged in a single display. As can be seen, stack-bar histogram 1406, from FIG. 14, is the seventh stack-bar histogram of sixteen that are shown in display 1502. The relative vertical positions and heights of the stack-bar histograms shown in display 1502 reflect the upper and lower limits of the data represented by the individual histograms. Additionally, each of the stack-bar histograms in display 1502 includes a boundary, such as dark line 1504 in stack-bar histogram 1406, which indicates the median of the data that is represented by the stack-bar histogram.
Displaying numerous stack-bar histograms side-by-side, as shown in display 1502, makes it easy to track shifts in the mean, and in the shape of the distribution. For example, in display 1502, it is easy to see that the mean of the metric tended upward at first, and then leveled off. It can also be seen that the distribution varied from one where most of the values were evenly distributed about the median to others where most of the values concentrated near the lower or higher end of the range.
FIG. 16 shows a time series of stack-bar histograms, such as is shown in FIG. 15, with the data from which the histograms were generated overlaid on the stack-bar histograms. Display 1602 shows that the stack-bar histograms are accurate representations of where the data is concentrated, and that they reasonably show the spread in each time interval, reflecting the shape and trend of the original data. The darker shaded or textured areas of the stack-bar histograms in display 1602 correctly indicate the heavy concentrations of data points, and the lighter shaded or textured areas correctly indicate the light concentrations of data points. Because the stack-bar histograms show the 5%–95% values of the data, the actual minimum and maximum limits of the data can be seen, and can be read from the vertical scale of display 1602.
FIG. 17 shows a display 1702 of an exemplary embodiment of a monitoring system that uses stack-bar histograms, in accordance with the principles of the invention. The main area 1704 of display 1702 shows 48 stack-bar histograms, representing twelve hours of data, at fifteen minute intervals. Options for main area 1704 are controlled by option select buttons 1706, which include options for showing stack-bar histograms, for showing extreme values (min and max), for showing limits, which may be dynamically computed, for showing the median, and for showing certain key metric event indicators, and root cause indicators. Other options may also be included in option select buttons 1706.
Display 1702 also includes statistics area 1708, in which the minimum, maximum, median, and 5th and 95th percentiles for a currently selected interval are shown. In Limits area 1710, upper and lower dynamic limits, such as those described in commonly owned, co-pending U.S. patent application Ser. No. 10/198,689, filed on Jul. 18, 2002, are shown. Histogram area 1712 displays a regular histogram for the currently selected area, and permits a user to view information including the range and count in each bin of the histogram by placing the cursor over the bars that represent the bins of the histogram.
It will be understood that display 1702 is an example of one display screen that uses stack-bar histograms, and that many variations are possible. Generally, such stack-bar histograms may be used in any system in which it is desirable to simultaneously display data distribution information over numerous related sets of data.
Merging Sets of Quantile Functions
When building displays based on stack-bar histograms, as shown in the foregoing figures, it may be useful to be able to aggregate multiple quantile functions, either to combine multiple time intervals, or to represent an aggregation of multiple instances of the same variable at the same time interval. Since direct quantile averaging methods generally do not preserve the overall range and distribution information from the individual quantile functions, it may be desirable to use a merging technique for quantile functions, as described hereinbelow.
For example, given two condensed quantile function tables (Qa, Qb) representing the quantile functions for a single metric for two adjacent time intervals, a single merged quantile function may be produced. When two quantile functions are merged, the resulting quantile function is approximately the same as that which would have been created if the two original data sets were merged and the quantile function of the resulting data set was computed. When this is done, the total range and distribution of the two data sets is preserved.
FIG. 18 shows an example of merged sample quantile function 1802, sample quantile function of the joined data 1804, and sample quantile functions 1806 and 1808 of the two original data sets. This merging technique is easily extended to the merging of multiple quantile functions.
The merge is accomplished by interleaving of the quantile values of the quantile functions to be merged, and then computing the average of Qa−1 and Qb−1 at each interleaved value. This has the effect of determining at each value (vi), what percentage of the values from the data associated with Qa would be less than vi, and what percentage of those associated with Qb would be less than vi. Given that an equal number of total samples are drawn from each data set, the average percentage Qm−1(vi) is the percentage of the total that would be less than the quantile value vi at the given point. This may be expressed as:

Qm−1(vi)=(Qa−1(vi)+Qb−1(vi))/2

FIG. 19 shows an example in which stack-bar histograms 1902, which are the same as the stack-bar histograms shown in FIG. 15, are merged using the above-described method to form stack-bar histograms 1904. Stack-bar histograms 1904 are formed by merging every two quantile tables of stack-bar histograms 1902. FIG. 20 shows the new condensed stack-bar chart with a data point overlay, demonstrating the accuracy of this method of graphic generation from merged quantile function tables. The merged stack-bar histograms are based on the estimated histograms of the merged data sets. As can be seen, these merged estimated histograms preserve the distribution information of the combined data.
FIG. 21 shows a flowchart of a fast algorithm 2100 for merging quantile functions. When merging quantile tables, the inverse of the quantile function is evaluated for each quantile table at values spread over the total range of all the quantile tables. A performance improvement may be obtained by noting that the inverses can be evaluated on a sorted set of values, where each value is greater than the previous. Thus, for each quantile table, the current value can be found by searching ahead from the point at which the last value was found. This may be on the current interval between two table entries, or on the next interval between two table entries.
The algorithm operates on a set of K quantile tables, and produces a merged quantile table.
At step 2102, an array of K quantile table indices (indexArray) are created, and each index is set to 1.
Next, at step 2104, the smallest minimum (setMin) and the largest maximum (setMax) are found over all the quantile tables that are being merged.
In step 2106, the maximum number of points for the merged quantile table is set to a “reasonable” value, M. Typical values of M may be the sum of the number of points in each quantile table, the average number of points in each quantile table, or a value between these two. In step 2108, the system creates an empty array of M values to hold the result of merging the quantile tables (mergedQuantile).
In step 2110, the system sets a variable (deltaV) representing the change in value for each step to the difference between setMax and setMin, divided by the number of merged quantile points, M. In step 2112, the system sets the current value (currValue) to setMin plus delta V. Next, in step 2114, the system sets the value of a variable, probSum, to zero, to begin accumulation for an average.
In step 2116, for each quantile table (i) in the set of quantile tables being merged, the system increments indexArray[j] until currValue is between the indexArray[j] and indexArray[j]+1 entries in the quantile table. The system then linearly interpolates on this interval to estimate the probability (p) associated with the value currValue, given the interval endpoints. The result, p, is an estimate of the inverse quantile function Q−1(currValue). The probability, p, is then accumulated into probSum.
In step 2118, the average cumulative probability, cp, is computed as probSum divided by K.
In step 2120, the system saves the pair {cp, currValue} as the next point in the merged quantile table, mergedQuantile.
In step 2122, deltaV is added to currValue, and steps 2114 through 2122 are repeated until currValue reaches setMax−deltaV (step 2124).
When the process is complete, in step 2126, the table mergedQuantile holds the resulting merged quantile table.
Note that because FIGS. 1, 2, 12, 13, and 21 are block diagrams, the enumerated items are shown as individual elements. In actual implementations of the invention, however, they may be inseparable components of other electronic devices such as a digital computer. Thus, actions described above may be implemented in software that may be embodied in an article of manufacture that includes a program storage medium.

## Claims

1. A method for optimizing a distributed process system including providing a visual indication of behavior and trends by generating an approximate histogram of a data set, the method comprising the steps of:
applying a quantile function on the data set to create a computational result;
selecting a subset of the data set in response to the computational result;
determining a condensed quantile function from the subset of the data set; and
rendering the approximate visual histogram display in response to the condensed quantile function, including
calculating an expected sample count based at least in part on an inverse of the condensed quantile function.

2. The method of claim 1 wherein the subset of the data set includes at least one of a minimum value of the data set, a median value of the data set, and a maximum value of the data set.

3. The method of claim 1 wherein the step of determining the condensed quantile function further comprises the step of interpolating between a plurality of values in the data set.

4. The method of claim 1 wherein the interpolating step comprises at least one of the linear interpolation and polynomial interpolation.

5. The method of claim 1 wherein the approximate histogram comprises a plurality of bins, the rendering step further comprising the steps of:
reducing the plurality of bins in the approximate histogram into a plurality of adjacent cells; and
applying an indicium to each cell in response to a percentage of the data set within each cell.

6. The method of claim 5 wherein the indicium is visually discernable.

7. The method of claim 1 for optimizing a distributed process system including providing a visual indication of behavior and trends, further comprising the steps of merging a plurality of data sets with reduced data storage requirements, comprising the steps of:
calculating a condensed quantile function for each data set, each condensed quantile function supplying quantile values;
interleaving the quantile values;
calculating an inverse of each condensed quantile function at each interleaved quantile value;
calculating an average of the inverse of the condensed quantile functions at each interleaved quantile value;
defining a merged quantile function as an inverse of the average of the inverse of the condensed quantile functions at each interleaved quantile value, and
rendering a merged histogram in response to the merged quantile function.

8. The method of claim 7 wherein the plurality of data sets comprise data associated with a single variable from adjacent time intervals.

9. The method of claim 7 wherein the plurality of data sets comprise data associated with a plurality of instances of a single variable from a single time interval.

10. The method of claim 7 wherein the step of rendering the merged histogram further comprises the step of calculating an expected sample count based at least in part on an inverse of the merged quantile function.

11. The method of claim 7 wherein the step of rendering the merged histogram further comprises the steps of:
reducing a plurality of bins in the merged histogram into a plurality of adjacent cells; and
applying an indicium to each cell in response to a percentage of the data set within each cell.

12. The method of claim 11 wherein the indicium is visually discernable.

13. A method of optimizing performance in a distributed transaction system, the method comprising the steps of:
collecting data associated with at least one system performance metric;
applying a quantile function on the data to create a computational result;
selecting a subset of the data in response to the computational result;
determining a condensed quantile function from the subset of the data;
rendering at least one approximate histogram in response to the condensed quantile function, including
calculating an expected sample count based at least in part on an inverse of the condensed quantile function;

identifying at least one trend in the at least one approximate histogram; and
adjusting, on an as needed basis, operation of the distributed transaction system to modify the at least one trend.

14. An apparatus for optimizing performance in a distributed transaction system comprising:
a data collection apparatus for collecting transaction system performance data;
logic to apply a quantile function to the transaction system performance data, creating a computational result;
logic to select a subset of the transaction system performance data in response to the computational result;
logic to determine a condensed quantile function from the subset of the transaction system performance data;
logic to render an approximate histogram in response to the condensed quantile function, including
calculating an expected sample count based at least in part on an inverse of the condensed quantile function; and

a display to render the approximate histogram.

15. An article of manufacture comprising a program storage medium having computer readable program code embodied therein for causing the generation of an approximate histogram of a data set, the computer readable program code in the article of manufacture including:
computer readable code for causing a computer to apply a quantile function on the data set to create a computational result;
computer readable code for causing a computer to select a subset of the data set in response to the computational result;
computer readable code for causing a computer to determine a condensed quantile function from the subset of the data set; and
computer readable code for causing a computer to render the approximate histogram in response to the condensed quantile function, so as to generate the approximate histogram, including
calculating an expected sample count based at least in part on an inverse of the condensed quantile function.

16. A program storage medium readable by a computer, tangibly embodying a program of instructions executable by the computer to perform method steps for generating an approximate histogram of a data set, the method steps comprising:
applying a quantile function on the data set to create a computational result;
selecting a subset of the data set in response to the computational result;
determining a condensed quantile function from the subset of the data set; and
rendering the approximate histogram in response to the condensed quantile function, so as to generate the approximate histogram, including
calculating an expected sample count based at least in part on an inverse of the condensed quantile function.

17. A method for detecting irregularities in time series data representing the performance of a complex system, comprising the steps of:
generating a quantile representation of at least one time series segment of the time series data,
determining a condensed quantile representation of the at least one segment,
merging sets of the condensed quantile representations,
rendering an approximate histogram of each merged set of the condensed quantile representations, and
concurrently displaying a plurality of associated histograms of merged sets of condensed quantile representations as a set of stack-bar histogram charts.