FusionReactor Blog - News and expert analysis for Java APM users.

Announcing FusionReactor 6.2

We’re happy to announce the latest release of FusionReactor – 6.2.   This release contains around a dozen cool new features and improvements.   You can see a list of all the new stuff on the Release Notes page or simply just go and download it here.

One of the most interesting new features is the Applications View.   Users who are familiar with FR6 will have already taken note of the new capability to filter requests and transactions on Application and lower level categories, which we call “flavors” and “subflavors” – the bottom line is that for Web Requests, we may have Web as the flavor of the request and then subflavors would be the HTTP methods of the Web Request, such as – GET, POST etc.

Why is the useful ?   Well the Applications View can now give you a great visual breakdown of how much each of those requests are effecting your application – in terms of processing time and hit counts.   You can see this from the image below.

Applications View

Using the time filter, you can easily take snapshots of time to see how your applications are being utilized. This is great for identifying potential performance bottlenecks. This view also provides some interesting details, showing breakdowns of memory used, duration (compared with average duration), hits and errors generated via that call – plus the amount of CPU used (in ms).

Application Detail View

Production Java Profiler Extensions

FusionReactor 6 Ultimate Edition now includes a Production Profiler for Java, which is designed to help you identify bottlenecks in your production environment. The Production Profiler is VERY low overhead, so you gain maximum benefit, without impacting your applications.

A new feature in the profiler is to enable On-Demand decompiles as well as integrated Debug Triggers to be set directly from the Profile Page.   This is another example of how easy it is to get to the root of your issues using FusionReactor.   Links to the Decompiler and Debugger are highlighted in RED and GREEN respectively.

Java Profiler

Last, but not least… FusionCLOUD

One of the most significant things is that 6.2 is actually our official FusionReactor agent release for FusionCLOUD.

Most of you will be saying – FusionCLOUD – what’s that…?   Well, we’ve been running FusionCLOUD as an invite only beta for around 12 months now.   FusionCLOUD is our exciting new service which extends the on-premise version of FusionReactor to add a broad range of extended functionality available via the cloud.

So what will FusionCLOUD have to offer…?

  • Many of the features you’re already familiar with in FusionReactor, such as Running Request, Stacktraces, Web Metrics view, Resources View
  • CLOUD Dashboard – similar to Enterprise Dashboard but very configurable, with extended views and sophisticated threshold setting
  • Secure Bi-directional channel (SOCKET) – ability to send requests down to your server from FusionCLOUD e.g. launch a Stack Trace / Garbage Collection / Execute script
  • Application view – the app view provides FR users with the insight into how your actual application is performing – not just web requests or transactions as we have in FusionReactor.
  • Alerting Engine – with full integration to alert with emails, PageDuty, HipChat, Email, Slack, OpsGenie , VictorOps, FLOWDOCK, Twilio, IRCCAT etc.

FusionCLOUD Request Throuput
If you are interested in getting some more information on FusionCLOUD or would like to jump onto the FusionCLOUD Early Bird program – please contact sales

FusionReactor features in the DZone Performance & Monitoring Guide

FusionReactor features in the DZone Performance & Monitoring GuideDZone have just published the 2016 Performance & Monitoring Guide and FusionReactor are featured in it. According to DZone’s research, it states that the #1 tool for finding production issues is APPLICATION LOGS (90% of respondents) – which we think is pretty SAD – because delving through logs is painstaking, time consuming and generally not very much fun.

So why are traditional APM tools not solving this issue?

Well, your typical APM tools provide some neat metric graphs and can alert you when something seems wrong, but they don’t tell you much at the level of detail software engineers need to get to the actual root of the issue. So you end up having to grep through logs, dive into the heap, tally your object instances, run stack trace over and over, guess some breakpoints or include debug data into our code (WOW – things are REALLY BAD).

When something breaks in production, developers must go deeper than resource usage or business transaction fail rates – they need real-time insight and transparency into what the application is actually doing at the point that it’s breaking – in production.

In order to pinpoint issues in production we believe developers need additional tooling which is actually closer to what they would use in their development/test environments. Developers need to see things like:

  • stack trace and local variable visibility, at the exact point of failure or deadlock
  • profiling information, when code is run against ‘real production data’ – so that performance bottlenecks can be identified
  • transactions, web and JDBC requests not just measured by time, but also by the amount of memory consumed
  • class loads/unloads & memory allocation (heap + non-heap) across time

FusionReactor Ultimate Edition is designed to give the level of detail software engineers need to get to the actual root of the issue and provides low-overhead production-grade tools to give access to detailed information needed to “deep-dive” & quickly figure out the hard stuff developers need to fix. FusionReactor doesn’t “just monitor” and put the burden on you to figure things out. FusionReactor puts you in control, so that you can instantly isolate production issues and performance bottlenecks with our integrated low overhead Production Debugger and Java Profiler. Plus, it will pro-actively improve application resilience with our unique Crash Protection capability.

No other monitoring solution gives you the same level of depth, insight or control of your Java applications ‘in production’.

If you’re not using Fusion Ultimate Edition already, please contact sales and we would be happy to provide you with an Ultimate Trial license – or if you’re new to FusionReactor, just download our 14 day Free Trial

Introducing FusionReactor’s Production Java Profiler

If you’re trying to root out application performance bottlenecks on your production JVM environment – then you are faced with some significant challenges.

Knowing where and what to tune up within your applications can be a major headache. APM tools can help and generally they provide metrics which will highlight slow running queries or poorly performing requests. However, what if you’re looking for performance issues within your actual code – you know it’s performing poorly – but you want to understand exactly how slow and then figure out why!

For performance issues, (unless you’re already using FusionReactor!) you may think of using a profiler, such as JProfiler or jvisualvm. However, it’s not easy to attach such tools to a specific process (especially in production) and it’s common knowledge that such tools impose a heavy performance burden themselves which essentially will render them useless in a production environment.

We now have an alternative – FusionReactor’s Production Java Profiler.

FusionReactor 6 Ultimate Edition now includes a Production Profiler for Java, which is designed to help you identify bottlenecks in your production environment. The Production Profiler is VERY low overhead, so you gain maximum benefit, without impacting your applications. The profiler may be run on demand, but is switched on by default, so that it will automatically profile your application as soon as it detects a long running request or transaction. You can also limit the number of profile samples which are taken, which will enable you to control the level of accuracy of the sample. Our tests have shown that even with limited samples, the insight you gain into performance bottlenecks is invaluable.

What can you profile?

Any requests or transactions which are running on the JVM – e.g. Tomcat, JBoss, WildFly, Glassfish, Jetty etc. ColdFusion applications can also be profiled– as well as any other applications which are currently being monitored by FusionReactor 6.1 or higher.

What do you have to do to start profiling?

Install FusionReactor 6.1 or above – activate it using either a TRIAL license, or your own FR Ultimate license – and that’s it. The Production Profiler is automatically configured to immediately profile any request or transaction which runs longer than 3 seconds. The default profiling sample is 200ms.

You can also prProfiler Iconsofile individual requests by simply clicking on the Profile now button – indicated by the Clock icon – which you can see next to any running request.

As requests are profiled, they will be listed in the Profiled requests or transactions screen – as in the example below.

Profiled Transactions WebRequest

Clicking on the Profiler link, will take you to the Profiler details page – which shows a breakdown– represented in time and percent of how long was spent in specific sections/areas of your application code. The profile taken is basically an inverted view of the call stack.


Bottlenecks are generally easy to spot. In our opinion, optimizing every part of your code is not worth the effort. Efforts should be focused on code segments where returns are higher, or rather highest.

Features and Benefits

  • When FusionReactor Ultimate is running, then profiling will start automatically for any request/transaction which runs for longer than 3 seconds. Note that this threshold can be easily altered to suit your needs.
  • Profiling can also be started on demand.
  • Find the root cause of performance bottlenecks in your application by viewing the profiled call stack in a top to bottom view.
  • Performance is shown in terms of time spent within that method – shown in seconds. The time will also be shown as a percentage.
  • Profile anything that runs on the JVM – without having to make any Java command line changes or restarting any processes – everything is built into FusionReactor Ultimate Edition.

If you would like to evaluate FusionReactor Ultimate – please download a trial license here

Transaction Memory Values Explained

One of the metrics gathered by FusionReactor during the execution of a transaction (request) is the memory usage of the transaction. This is displayed on the Main tab in the transaction details page. Since FusionReactor 6 we have added the Transaction Allocated Memory value to these details. All of these numbers can be a little confusing so below we have explained what all the memory values mean.

Explaining FusionReactor Transaction/Request Memory Values

The first few numbers are quite straight forward. These are simply a snap shot of the JVM state at either the start of the transaction (for transactions that are still running), or at the end of the transaction (for transactions that are finished).

Used Memory

This is the amount of memory that is currently used by the JVM, shown as both a absolute byte value and as a percentage of the maximum memory.

Max Memory

This is the maximum amount of memory that the JVM is allowed to use. This can be defined using the -Xmx Java argument.

Total Free Memory

This is the actual amount of memory that is not used by the JVM, this includes memory that has been allocated but not used yet. i.e. this is max memory minus used memory.

Allocated Memory

This is the current amount of memory that has been allocated by the JVM.

Free Memory

This is the amount of memory that has not been allocated by JVM. i.e. max memory minus allocated memory.

Transaction Allocated Memory

This value needs some deeper explanation in order to avoid confusion. This number is the total number of bytes that have been allocated during the life time of the transaction. Every time an object is created a portion of the JVM memory is used to hold this object, of course in java the garbage collector (GC) will automatically free any memory that is no longer needed.

This means that you can the reuse the same memory space again. So if we run the bit of code below, we will allocate memory space the string 10 times. Resulting in the transaction allocated memory value being 10 times the size of the single string.

for(int i = 0; i < 10; i++)

String str = “this is a string”;


This would mean that even if you have a max heap of 8 gigabyte the transaction allocated memory value can exceed this value. This would indicate that JVM is allocating and then freeing lots of object. If we look at the image below you can see that a single transaction can allocate more than the maximum heap, as long as it does not do it all in one go.

Transaction Memory Vales 2

2015 Wrap-Up – hello FR6 and Happy Birthday FusionReactor !

What a year 2015 has been – I just wanted to share some of the highlights we’ve achieved :

1. We launched FusionReactor 6 – with loads of new features – some significant performance improvements as well as the new ULTIMATE Edition with the Production Debugger
2. We applied for our first ever patent – which was actually for the Production Debugger
3. Sold our 25,000’th FusionReactor license
4. FusionReactor was 10 YEARS OLD in December 2015
5. Rolled out FusionReactor CLOUD Beta – which is currently hosting over 1000 server instances !
6. Sponsored a number of events, including dev.Objective(); Into The Box in Minneapolis, CFCAMP in Munich, Germany, Velocity in New York & the Adobe ColdFusion Summit in Las Vegas
7. Launched the new FusionReactor website – https://www.fusion-reactor.com
8. Introduced a FusionReactor Developer Edition (will post a separate article on this)
9. Launched FeeFo independent review service for FR – see Customer Reviews for the current score https://www.fusion-reactor.com/customer-reviews/
10. Look out 2016 – with the planned launch of FusionReactor CLOUD + lots of new goodies planned for FusionReactor – it’s going to be VERY BUSY

Finally, as the end of the year rapidly approaches I would like to take this opportunity to wish you all the very best for the holiday season and good health, happiness and success for 2016.

Best Wishes,

David Tattersall

CEO Intergral – makers of FusionReactor Application Performance Monitor

Announcing FusionReactor 6 – the wait is over !

After approximately 10 years of engineering, 100 meetings, 1,000 pizzas and 10,000 cups of coffee we’re now ready with FusionReactor 6 – it’s taken a while – but it’s worth it and FR6 is by far the best, fastest and most feature rich version of FusionReactor ever launched. Oh – and as everything seems to be the power of 10 – FusionReactor is also exactly 10 years old this month 🙂

What’s different…? Well, FR6 includes tons of new features and improvements, but one feature really stands out – which is the Production Debugger available in the new ULTIMATE Edition of FusionReactor. We’ve always believed that monitoring is really a means to an end. The end goal is about your company being able to deliver your service, such that your customers are satisfied and your business makes money. So your applications need to be free of defects and always ON. Unfortunately, all software has defects, but we believe that the measure of a great monitor, is the speed at which the monitor can highlight and direct you to the defect, so that you can actually get it fixed and restore service.

FusionReactor has always been about giving you accurate, real-time insight into what’s happening on your server/application right now and the Production Debugger available in the ULTIMATE Edition takes that goal to a whole new level.

How to get FusionReactor Ultimate Edition

FusionReactor ULTIMATE can be purchased separately and it’s also possible to upgrade from either Standard or Enterprise Editions. Please contact sales for more details.

Here are some of the highlights which FR6 has to offer:

  • Memory Usage metrics
  • Application Filter view
  • Application Session Tracking
  • Enhanced Garbage Collection Analysis
  • SQL Query Planner (Explain)
  • ColdFusion Extended Metrics visualized
  • On the fly code de-compilation
  • Improved Notification Center
  • Improved Java Frameworks – Spring, Struts
  • Support for Fusion SaaS (CLOUD) – note Fusion SaaS will be released separately to FR6

The whole team is very proud of what we’ve achieved with FusionReactor 6 and we very much hope that you enjoy using it and that it continues to be your first choice tool to monitor, detect issues and protect your applications and servers.

David Tattersall
CEO Intergral – makers of FusionReactor, FusionAnalytics and FusionDebug

FusionReactor 6 sneak peek – Re-writing the definition of what Application Performance Monitoring is all about!

APM tools have emerged as a category to help businesses address issues when applications break or systems are slow. Unfortunately, even though many of those tools measure metrics and provide some insight into what’s going on, they don’t do anything to minimize downtime and really accelerate time to fix. To be honest, traditional APM tools simply don’t do enough.
FusionReactor 6 takes a different approach – we not only provide the basics and core APM expectations that every user has for server monitoring, FusionReactor 6 introduces the unique and patented capability that allows you to do real-time Production Debugging, a game changer in accelerating the time needed to IDENTIFY and FIX issues – PLUS FR’s unique Crash Protection, which will alert you and guard your servers against crashes, so you can take action BEFORE systems go down – resulting in high application and server resilience, improved quality, less downtime and happier customers !
FusionReactor 6 is breaking the mold of traditional APM tools and will enable you keep your production systems online longer and with better results.

Here are some of the highlights which you can you expect with FR6:

  • Production Debugging / Alerting
  • Enhanced Crash Protection / Scripting
  • System Monitor – extensive metrics
  • Daily + Service Level Reports + weekly, monthly summaries
  • Enhanced Stack Trace Analysis (Trace Assist)
  • Memory Usage metrics
  • Application Filter view
  • Application Session Tracking
  • Enhanced Garbage Collection Analysis
  • SQL Query Planner (Explain)
  • ColdFusion Extended Metrics visualized
  • On the fly code de-compilation
  • Improved Notification Center
  • Improved Support for Java Frameworks
  • Support for Fusion SaaS (CLOUD) – note Fusion SaaS will be released separately to FR6

Production Debugging/Alerting

Did you ever hear someone say, “We can’t reproduce that problem, it ONLY ever happens in production” – well, with the introduction of FR6’s new Production Debugging (PD) capability, this will become a thing of the past.
Production Debug gives you all the control you need to simply and securely interact with your production environment as issues unfold. The insight it provides will revolutionize how you identify problems.   Unlike a typical debugger, you can setup conditional breakpoints and be alerted by email when they fire.   The email will contain a link to the debug session, as well as stack trace and variable details at the instant the break point fired.   It has NEVER been easier and faster to get to the root of issues.

Production Debug

The Production Debug feature will only be available in the new FusionReactor Ultimate Edition.

Key features include:

  • Interactive debugger within FusionReactor’s interface
  • Conditional breakpoint (BP) and break on exception handling – allowing full control of debug sessions in your production environment
  • Usual debug features e.g. alter variable, step into, out etc.
  • Email breakpoint notification – when a breakpoint fires, FusionReactor will hold the thread and send you a link to the debugger at that point. Restricting this to a single thread ensures that your production environment is not impacted by the Production Debugger
  • Time controlled handling mechanism, allowing you to easily control how your production system handles break points / exceptions / debug sessions
  • Exception Alert Email – including Stack trace + Stack context – will enable rapid identification of issues
  • Visual indication (in the FR banner) that a Production Debug trigger has occurred
    Bug Notification

System Monitor

Over the years, customers have often asked for other system related metrics which were usually only available in more traditional system monitoring tools. We have now extended FR6 to include a wide range of new metrics and system specific information. Access to this information is via the System Resources icon in the main FusionReactor interface.

The new metrics being tracked, include:

  • System Environment details
  • Java Environment details
  • Currently logged in users
  • Network Details
  • Memory Swap Information
  • System Console Access
  • Running processes page; showing:
    • CPU usage
    • Memory usage
    • File descriptors
    • Threads
  • Process details page; showing:
    • Memory details
    • Environment variables
    • Modules
    • Process arguments
  • Disk IO / Per disk
  • Network IO / Per network adaptor
  • Disk Usage & capacity – broken down per disk
  • CPU usage per core
  • CPU usage break down (nice/wait/system/user)

System Metrics

Another important feature is the ability to set disk space thresholds, so now FusionReactor can alert you when disk space reaches a defined limit.

New FusionReactor Reports

Daily Reports

Feedback to the original FR Daily Report was really positive and we wanted to build on that with our new Daily Report, which adds additional information and draws your attention to potential issues and/or improvements in performance and stability. The new layout includes both previous values, and targets for those values. We think that this will allow for a better overview of how your server is doing on a day to day basis.

We have also added some more statistics to the report including number of sessions and number of 404 errors. In addition to these metrics we have added a breakdown of the recorded outage, with estimated start and end dates and times, durations and the reason for the outage. We also now have a breakdown of all response codes for the reported period, with average runtime, count and its percentage out of all requests.

Along with the Service Level report, we are introducing a Weekly report, which will produce a summary of your server for the week, as well as a monthly report, which will produce a summary of the calendar month.

ColdFusion Metrics Page

FR5 already collected a number of specific ColdFusion metrics. Till now, these were stored in various log files and were only available visually via FusionAnalytics. FR6 has 2 new screens available which break down the CF metrics and display them in graphical form. Some of the metrics shown, include : Active Sessions, # of current sessions, Template Requests, Web Service requests, App Scope Size, hit counts (breakdown of hits per request type) etc.

ColdFusion Metrics

SQL – Query Plan (Explain)

Since SQL is declarative language, there are typically a large number of alternative ways to execute a given query. These alternatives can provide widely varying performance. JDBC is typically one of the main areas which we find at the root of application related performance issues.

FusionReactor 6 has the capability to attach an SQL Query Plan to the given JDBC transaction in the event that the SQL statement execution is longer than a given time. This is made available on the transaction details page. This feature will provide database users and administrators the capability to manually examine the plans produced by the optimizer to spot potential performance issues. FusionReactor will run the query plan immediately after the actual query is executed.

FusionReactor 6 Query Plan

Session Tracking and Visualization per Application

In the stateless HTTP web world, Session’s play an important role for maintaining client state. Sessions are generally used to store user data – which can quickly eat up memory if not kept in check. Sessions are tracked (and identified) using a session ID. FR6 is now tracking and visualizing sessions. All created, destroyed and active sessions are tracked per application.

Session Planning

Northern Virginia ColdFusion Users Group FusionReactor Product Suite Presentation (Recorded November 2014)

Using FusionReactor, FusionAnalytics, and FusionDebug to Solve CF Server and Coding Challenges (Recorded November 2014)

Using FusionReactor, FusionAnalytics, and FusionDebug to Solve CF Server and Coding Challenges Presented to the Northern Virginia ColdFusion Users Group, Presented by Charlie Arehart (Recorded November, 2014)

In this 90 minute talk, veteran CFer Charlie Arehart will introduce and demonstrate the “Fusion tools”, FusionReactor (FR), FusionAnalytics (FA), and FusionDebug (FD). If you’re not familiar with the tools, or are not aware of how they have evolved, you’ll come to appreciate how they can quickly and easily help you solve server or coding challenges.

About the Northern Virginia ColdFusion Users Group

Northern Virginia ColdFusion Users Group meets (at a minimum) once per month.

Their aim is to provide opportunities for ColdFusion and Actionscript developers to meet and network with one another as well as opportunities to engage in presentations and learning to help sharpen your ColdFusion development skills.

They are an active group and always welcome new members. If you live or work (or can otherwise get to) Fairfax, VA then they would love to have you come out.

Relevant Links

Charlie Arehart: http://www.carehart.org/
Northern Virginia ColdFusion Users Group: http://www.meetup.com/nvcfug/

All about FusionReactor’s Daily Reports

Something you will hear over and over when looking at the APM space, is reports. Every APM solution has reports, and FusionReactor is no different.

With the release of FusionReactor 5.0.0, we included the Daily Report, which is a summary report which is sent as an email to the configured address(s) at the given time.  This plugin is very simple to use and just like other features in FusionReactor will work without a restart.   The idea behind this report is that it can be used to provide users with a quick indication of server health without having to check the instance directly via the FR interface.


A quick overview of what the daily report consists of before we get started in making it work for us.

You can see from the image that the daily report contains a break down of the up time, web request activity and the core resource usage. The report is intended to quickly put over the basic state of your server over the last 24 hours; and in my opinion does it quite well.

Uptime is measured as a percentage of that day that the server was online, effectively it is (1 day – downtime / 1day) * 100.


Daily Report Screenshot


I feel that the best thing about this feature is that there is very little to do, as is often the case when setting up FusionReactor. All you need to do to receive this report is to enter the mail server settings within the FusionReactor -> Settings page. I will not go through all the settings as for the most part they are fairly simple. There are also a few other things in this email settings which can be helpful to know. For any further help please refer to the docs here.

From Address

The “From Address” is actually not needed to send an email, and is usually just used as a method to identify the sender. What i like to do for the FusionReactor instances is to use this to indicate the instance/server that the email has come from. So for instance i have the current released version of FusionReactor running on the testfr server. I can then use the email address release@ testfr.com, so now i can apply filters to the email account that this mail is sent to, allowing to be have different folders in the mail client for the different instances/server.

Using this approach means i can just look at the new mails per folder to know it there is any missing.

Host Name

This field is quite often overlooked. As FusionReactor’s internal web server, and discovered host name, is usually hidden from the outside world. The links in the email will not work unless you are inside the correct network. This field allows you to specify the host name and port that should be used in the links in the email. This has no affect on the email server used or and functionality, it is simply a way to set the host name that this instance of FusionReactor is available on.

As you can see from this example you can also include port numbers.

Send Test Email

This last part of the form is quite useful, if not a little annoying in its implementation. Basically this little button will send a test mail using the entered settings, unfortunately you do need to save the settings prior to clicking this button. This hopefully will be fixed in FR 6.

If you have set up the email settings for your mail server correctly the you will receive an email report from FusionReactor at 00:05 (server time). If you want to change the time the report is sent or the recipients read on.

Advanced Settings

There are a few more settings that can be changed if you want to have the email sent at a different time, or have the report sent to recipients other than those in the default mail settings for the instance. These settings are available in plugin configuration screen, go to FusionReactor -> Plugins -> Active Plugins. Then click on the Configuration button for the FusionReactor Daily Report Plugin, there are not many plugins on this page so should be easy to find.

Firstly, send time. If you want the report to be sent at another time, simply change the “Report Time” field to the time that you want the report sent. Note: this time should be in 24hour format. You should also be aware that this time also indicates the time that the report takes as the end of the day. So if you change the time to be 12:00, the report will be for the time from 12:00 – 12:00.

Next we have recipients, this is fairly straight forward. A comma separated list of email address that the email should be sent to, these recipients are only used for this report. Also note that a blank field indicates that it will use the To Address in the FusionReactor -> Settings page.

No need for the Daily Report?

If you do not want to receive reports from FusionReactor then you can either remove the settings in FusionReactor -> Settings (which will prevent all emails from FusionReactor), or you can disable the plugin from the plugin configuration.

FR6 Reporting Sneak Peak

We received lots of positive feedback to the Daily Report in FusionReactor and we decided to further extend the reporting in the upcoming FusionReactor 6 release.  FR6 will include an improved new Daily Report, as well as a brand new Service Level Report.   Here is a sneak peak of some of the features you can expect.

  • Session activity
  • Improved source details
  • 404 count
  • Outage details Start – end times
  • Durations
  • Reason
  • HTTP response code break down
  • Trend indicators
  • Improved configurations
  • Daily AND weekly summaries !
Preview of FR6 Daily Reports

Getting custom instrumentation and metrics using FusionReactor: Examples with ColdFusion

FusionReactor will simply work out-of-the-box to give you masses of metric data and insight into requests, transactions, queries and resources without adding any additional code to your application.   However, if you want to get even more insight into specific areas of your application, then it’s easy to customize FusionReactor.   This level of customization will enable you to instrument specific parts of your code that FusionReactor (normally) does not track e.g. you can track method calls, web service calls – anything you like.   All this can be achieved by simply adding a few lines of code to instruct FusionReactor to track metrics, add properties to transactions or even create new child transactions around parts of your code.

In this post I will show you how to instrument your ColdFusion code to:

  • Create graphed series
  • Add properties to transactions
  • Create new Transactions

Creating a Graphed Series

The first step in creating a tracked series in FusionReactor is to create an instance of the FusionReactor API, playfully named FRAPI. This requires the use of the ColdFusion createObject call, see below.

Create FRAPI object
<cfset frapiObj = createObject("java", "com.intergral.fusionreactor.api.FRAPI")>
<cfset frapi = frapiObj.getInstance()>

From here all we need do is call the method on the frapi variable to post the metric, see below.


Post Float value
<cfset frapi.postNumericAggregateMetricFloat("/series/name", 10.0)>
 As ColdFusion can have some problems with distinguishing float and long primitive values there is also a method that takes a long, see below.
Post long value
 <cfset frapi.postNumericAggregateMetricLong("/series/name", 10)>
 Now both of these methods will take the value and post it to the given series name, in the event that that series does not exist it will be created automatically. These two methods will also create the standard numeric aggregates that are available in FusionReactor (1 Hour, 1 Day and 1 Week), if you do not want this much data from the series then you can use the alternative methods to post data without creating the aggregates.
Non Aggregated metrics
<cfset frapi.postNumericMetricLong("/series/name", 10)>
<cfset frapi.postNumericMetricFloat("/series/name", 10.0)>

The first call to post will create the series and aggregates, so if you first call is to postNumericAggregateMetric.. then the series will have the aggregates.  Similarly if you create the series using the postNumeric. then the series will not have the aggregates, even if a later post is to postNumericAggregate.


A Simple Example

Simulate Revenue being generated via sales and display the revenue in a graph within FusionReactor.

<cfloop from=1 to=120 index="j">
   frapi.postNumericAggregateMetric("/Revenue", RandRange(100,300));

Once you have posted the values to FRAPI you can see the graphs in FusionReactor on the Custom Metrics page. (Metrics -> Custom Metrics) and will be able to access the /Revenue values from the drop down menu.

FRAPI customization in FusionReactor


Add Properties to a Transaction

FusionReactor will automatically track lots of ColdFusion metrics, one of the most important is Web Requests. Along with tracking requests, FusionReactor is able to attach properties to requests so you can better diagnose problems later on. To attach a property to a transaction using ColdFusion see the code snippet below.


Adding properties to WebRequest
<cfset transaction = frapi.getActiveTransaction()>
<cfset transaction.setProperty("/property/name","StringValue")>

The setProperty method is effectively a map put, and is able to take any object as a value. However the FusionReactor UI is only able to display the value as a string, so it is a good idea to ensure the result of the toString method of the given object is a user friendly string.

It is even possible to use the FusionReactor as a kind of private session store, that is only available for the life time of that request. So similar as above, but by using the getActiveMasterTransaction you can always get the top level transaction on this request. The difference between getActiveMasterTransaction and getActiveTransaction is explained in the next section. With this top level transaction you can put and get properties from it just like a session, but this is only available for this request.


Get property from Transaction
<cfset transaction = frapi.getActiveMasterTransaction()>
<cfset prop = transaction.getProperty("/property/name")>

If you do put properties into the request it is important to remember that FusionReactor will keep these requests in memory for some time, depending on settings, so it is NOT ADVISABLE to put large objects into the request properties !


Creating new Transactions

As mentioned above, FusionReactor will automatically create many transactions to track WebRequests, JDBC requests, CFHTTP among many more.  Let’s imagine you have a function or section of code that you want to track the performance of.   Using FusionReactor you can wrap this section of code is a custom transaction to visualize the performance inside FusionReactor.   Doing this is very simple, image we have the below CFFunction code.


Example CFFunction
<cffunction name="newRandomNumber" access="public" returnType="string" output="false">
<cfset rndObj = createObject("java", "java.util.Random")>
<cfset rnd = rndObj.init()>
<cfset area = rnd.nextInt(99999)>
<cfreturn area>
 So from this example if we want to track all calls to this function all we need to is add a create and end transaction call.
Instrumented CFFunction
<cffunction name="newRandomNumber" access="public" returnType="string" output="false">
  <cfset frapiObj = createObject("java","com.intergral.fusionreactor.api.FRAPI")>
  <cfset frapi = frapiObj.getInstance()>
  <cfset trans = frapi.createTransaction("newRandomNumber")>
  <cfset rndObj = createObject("java", "java.util.Random")>
  <cfset rnd = rndObj.init()>
  <cfset area = rnd.nextInt(99999)>
  <cfset trans.close()>
  <cfreturn area>

This code will now create a transaction with the flavour “newRandomNumber”, which will be added as a child transaction to the web request and visible in the FusionReactor UI. Alternatively there is a createTrackedTransaction method that will do the same as the createTransaction but will also create a periodic sampler that will produce a activity and duration graph for the given transaction flavour.


These three features of FRAPI are a small select sample of the functions available, and offer some unique and powerful options to developers that are looking for ways to track performance and debug code. There are many other methods available via the FRAPI interface many of which are helpful for both tracking performance and debugging errors. For more information on the available methods please review the Java docs.