CacheBox: Enterprise Caching
7.x
7.x
  • Introduction
    • Contributing Guide
    • Release History
      • What's New With 7.2.0
      • What's New With 7.1.0
      • What's New With 7.0.0
    • Upgrading to CacheBox 7
    • About This Book
      • Author
  • Getting Started
    • Overview
    • Installing CacheBox
    • Creating CacheBox
      • Common CacheFactory Methods
      • Cache Cleanup/Reaping
  • Configuration
    • CacheBox Configuration
      • CacheBox DSL
        • Default Cache
      • CacheBox Config Object
      • ColdBox Configuration
  • Usage
    • Cache Providers
      • CF Providers
      • Lucee Providers
      • Mock Provider
      • CacheBox Provider
      • Couchbase Providers
    • CacheBox Object Stores
      • ConcurrentStore
      • ConcurrentSoftReferenceStore
      • DiskStore
      • JDBCStore
      • BlackholeStore
  • Advanced Usage
    • CacheBox Eviction Policies
      • Using Your Own Policy
    • CacheBox Event Model
      • CacheBox Events
      • Provider Events
      • Cache Listeners
    • Cache Reporting
      • Creating Your Own Skins
        • Skin Templates
        • ReportHandler
          • Action Commands
  • For The Geeks
    • Caching Concepts
      • Caching Considerations
      • Cache Loading
      • Definitions
      • Java Soft References
    • Cache Topologies
      • Single Instance/In-Process
      • Single Instance/Out-Process
      • Replicated
      • Distributed
    • CacheBox Architecture
      • CacheFactory
      • CacheBoxConfig
      • EventManager
      • ColdBox
      • LogBox
      • ICacheProvider
      • ICacheStats
      • IObjectStore
      • IEvictionPolicy
      • AbstractEvictionPolicy
      • IColdboxApplicationCache
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Advanced Usage

Cache Reporting

CacheBox comes with great reporting tools whether you are using it within a ColdBox application or standalone. This section deals with how to do a-la-carte reporting by using the custom tags that CacheBox ships with. Below is the simplest form of usage for the monitor reporting tags:

<cfimport prefix="cachebox" taglib="/cachebox/system/cache/report">

<---  Create CacheBox with default configuration --->
<cfif structKeyExists(url,"reinit") OR NOT structKeyExists(application,"cacheBox")>
    <cfset application.cacheBox   = new cachebox.system.cache.CacheFactory()>
<cfelse>
    <cfset cachebox = application.cacheBox>
</cfif>

<cfoutput>
<html>

    <head>
        <title>CacheBox Monitor Tool</title>
    </head>
    <body>

    <---  Special ToolBar --->
    <div id="toolbar">
        <input type="button" value="Reinit" onclick="window.location='index.cfm?reinit'"/>
    </div>

    <---  Render Report Here --->
    <cachebox:monitor cacheFactory="#cacheBox#"/>

    </body>
</html>
</cfoutput>

That's it! You basically import the tag library from /cachebox/system/cache/report and then use the monitor tag to render out the monitor. What's cool about the monitor is that it is completely skinnable. Please see the CacheBox Report Skins for more information.

Reporting Attributes

Let's check out the attributes for this custom tag:

Attribute

Type

Required

Default

Description

cacheFactory

cachebox.system.cache.CacheFactory

true

---

The reference to the CacheBox factory to report on.

baseURL

string

false

cgi.script_name

The location of the script so the tag can create links for Ajax calls and rendering calls.

skin

string

false

default

The name of the skin to use for rendering the report. The skins are found at /cachebox/system/cache/report/skins

Info Each skin can implement its own attributes, so always check the skins documentation to see what extra attributes it implements.

Here are some examples of the tag usage:

<cachebox:monitor cacheFactory="#cacheBox#"/>

<cachebox:monitor cacheFactory="#cacheBox#" baseURL="index.cfm?event=cacheMonitor"/>

<cachebox:monitor cacheFactory="#cacheBox#" skin="coolskin"/>

<---  Embedding report in a coldbox application's admin view --->
<cachebox:monitor cacheFactory="#controller.getCacheBox()#"
          baseURL="#event.buildLink(event.getCurrentEvent())#" />
PreviousCache ListenersNextCreating Your Own Skins

Last updated 2 years ago

Was this helpful?