Comments
litl_phil wrote: While it's nice that Google and Acer share the vision of cloud-based computing, it's also worth noting that we at litl already have a webbook on the market (available at litl.com) that runs our own cloud-based OS. Unlike Chrome, litlOS is focused on creating a new and better web experience for the home, so we don't have the usual browser interface, we have our own innovative UI. In conjunction with easel mode (litl's inverted-V position) and our growing cohort of litl channels (special apps t...
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Making Optimal Use of JMX in Custom Application Monitoring Systems
Some best practices and recommendations

Calculating Rates... It's Harder Than It Looks
Once the data are made available and properly identified, the problem then becomes presentation. One common requirement is to plot metrics like Msgs Sent and Rcvd in a trend chart.

Obviously, raw Total Msgs data shouldn't be plotted since it will increase continually. The delta from one event to the next must be computed and used to plot the trend.

This problem isn't unique to JMX - it's found in many systems that gather data in real-time. It's simple to count the messages, export that raw data, and let the monitoring client deal with the job of calculating deltas and rates.

However, at the client end it's not that simple, particularly when data are gathered from multiple sources. Table 5 and Table 6 contain data at two instants in time for just two channels, 12 and 13, on Server 1.

As long as the number of channels is the same at each time instant, the problem isn't so difficult. New values for Channel 12 are compared with previous values for Channel 12 to calculate a delta. It's the same for Channel 13. (Table 7)

To do this on the client side requires that one keeps a "cache" of prior data as obtained in the previous time interval. Additionally, each row of data must be cached by one or more "index" columns that uniquely identify the source. In this case, it's a combination of the Server and Channel columns that identify the rows to be compared.

This isn't overly difficult; there are simple algorithms for constructing a "key" from the index columns and storing a data row in a hashtable using that key. For each new row of data, old data are extracted using the key, a delta is computed, and the new data stored in place of the old.

However, it does put a burden on the developer of the monitoring client to maintain a cache and calculate deltas against the incoming streams of data. Had the delta values been computed and exposed in the MBean no such effort would be required.

In practice, it gets worse. Often, the number of sources doesn't remain constant. Channels may be created dynamically and the ID of each new channel is continually changing, starting at 1 and incrementing each time. Old channels may be closed and their IDs never reused.

In this situation, the cache we maintain to do the delta calculation keeps growing. (Table 8)

Here, channels 12 and 13 may be long gone, but the previous values stored in the cache are still there. To avoid a serious memory issue, the client code must provide a mechanism by which the cache can be cleared of items that are no longer needed. To do this requires that an event be generated, indicating that a channel has been closed.

Of course, we may need a "channel closed" event for other reasons, but to require it just so we can safely calculate deltas seems excessively burdensome.

Because this problem is seen so often, advanced visualization products usually provide built-in caching capability and transformations that can be used to perform the required work. However, when trying to apply a low-level charting package to the problem, one quickly finds that the problem is much bigger than originally thought.

The obvious recommendation here is to move the delta calculation back to the MBean code. In most cases, a "count" metric is going to be plotted, so provide the delta calculation upfront. It's usually much easier to do this at the source. There's no need for indexing of the data as the source contains both the old and new data. There's no need to worry about the comings and goings of the objects (e.g., channels) since the delta processing is self-contained in the object.

This is not to minimize the problems on the data-collection side either. There are difficulties that arise when moving the job back to the server. The problem now becomes how to manage the information so that it can be accessed by multiple clients without having to keep track of which client knows what.

The most common way of dealing with this is to provide the delta in terms of a "rate" rather than an absolute delta. This way the time interval for the calculation can be maintained independent of the client. The client can be supplied both the rate information and the original total information. In many cases, it's the rate that users want to see anyway, since the collection interval can vary and is really irrelevant.

Recommendation: Do delta calculations and/or rate computations on the server side rather than on the client. It's much more efficient and easier on the client-side developers.

Give Me a Break - Part 1
Another problem often seen in data collection systems is the inefficient encoding of information that's passed to the client for presentation. A good example of this is the "statistics" column in our sample MBean. (Table 9)

Often this is seen when the default view of the data is a simple HTML page. Having the metrics already available in a string form makes it easy to display in an HTML table without having to do numeric formatting.

Sometimes, developers are inclined to use XML since it's portable, easily parsed in client systems, and not binary:

<?xml version="1.0"?>
    <Statistics>
      <ProcessTime units="ms">124</ProcessTime>
      <WaitTime units="ms">34</WaitTime>
    </Statistics>

One argument for using either form is that the metrics encoded in the string are to be accessed as a unit, so it's clear that they represent a metric at the same instant in time.

However, most monitoring and visualization systems are fully capable of dealing with structured numeric data. JMX provides a simple OpenMBean data type called CompositeData. Several related measurements can easily be put in a Composite structure using JMX API calls. The data are transferred via JMX in an efficient binary form.

With XML or string encoding, the server must pack the data into a string and the client has to unpack it at the other end, knowing the schema for the data. Using CompositeData, a client has information immediately available about the semantics of the data. With strings, it has none.

Recommendation: Use structured Composite and Tabular data types wherever possible - and avoid string encoding that results in extra network overhead and more development work on the client side.


About Tom Lubinski
Tom Lubinski founded SL Corporation in 1984 and is currently the company's president and CEO. He has been instrumental in developing SL's Graphical Modeling System software and Enterprise RTView, a real-time monitoring, analytics and visualization platform. Since founding the company, he has been involved in thousands of successful customer deployments of real-time visibility solutions. Prior to starting SL Corporation, Tom attended the California Institute of Technology and developed a substantial consulting practice specializing in object-oriented programming and graphical visualization systems. He has over 30 years of experience in the development of computer hardware systems and software applications.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Enterprise Open Source Magazine Latest Stories . . .
Oracle seems to have divided the open source ranks over the MySQL delay it’s having closing its acquisition of Sun. Eben Moglin, the GPL’s most ardent defender and delineator, the lawyer who has worked hand in glove for years with the Free Software Foundation’s founder Richard Stallman...
Cloud computing is a game changer. The cloud is disrupting traditional software and hardware business models by disrupting how IT service gets delivered. Entrepreneurial opportunities abound as this classic disruptive technology begins to proliferate, so it is no surprise that SYS-CON'...
The irony is that Oracle has advanced MySQL, lost money in the process, and helped its competitors - all at the same time. When Oracle buys Sun and controls MySQL the gift (other than to Microsoft SQL Server) keeps on giving as the existential threat to RDBs is managed by Redwood Shore...
WSO2, the open source SOA company, today announced the launch of the WSO2 Cloud Platform. Available today, the new WSO2 Cloud Platform features a family of WSO2 Cloud Virtual Machines; WSO2 Cloud Connectors for enabling fast, secure cloud services; and the multi-tenant WSO2 Governance-...
Now, the open source Mozilla Thunderbird client software can be used with Open-Xchange collaboration software. The "Community OXtender for Thunderbird" software connector gives users full access to appointments and contacts stored in the Open-Xchange Server and enables them to use Thun...
Morph Labs, a leading provider of enterprise cloud computing technology, today announced an introductory trial of the Morph CloudServer, an open, standards-based server IT organizations can use to rapidly model and evaluate their cloud implementations. A miniature "Cloud Environment in...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE