UI stuff:
- server info:
-- Main: says "Failover mode   disk-based-active-passive" even with only 1 server in cluster
- Cluster "recording on" light should be doc in Lock Profiler and Statistics Recorder, and where ever else it's triggered from

h1. Terracotta Developer Console


h2. Introduction
The Terracotta Developer Console delivers a full-featured monitoring and diagnostics tool aimed at the development and testing phases of an application clustered with Terracotta. Use the Developer Console to isolate issues, discover tuning opportunities, observe application behavior with clustering, and learn how the cluster holds up under load and failure conditions. The console functions as a JMX client with a graphical user interface.

Enterprise versions of Terracotta also include the Terracotta Operations Center, a GUI operator's console offering features such as backups of shared data, client disconnect, and server shutdown controls. To learn more about the many benefits of an enterprise version of Terracotta, see our [Enterprise Products|enterprise:Products].

Using the console, you can perform the following tasks:

* Monitor the health of servers and clients under changing conditions.
* Force distributed garbage collection operations.
* View cluster-wide statistics.
* Record cluster statistics for later display.
* Receive console status and server log messages in a console window.
* Find exactly which classes are being shared in the cluster.

These and other console features are described below.

h2. Launching the Terracotta Developer Console

You can launch the Terracotta Developer Console from a command line.

h5. Microsoft Windows

{{\[PROMPT\] %TERRACOTTA_HOME%\bin\dev-console.bat}}

h5. UNIX/Linux

{{\[PROMPT\] $\{TERRACOTTA_HOME\}/bin/dev-console.sh&}}

The console can also be launched from the Terracotta Welcome application. If you are new to Terracotta, [take the tour|orgsite:Tour] to learn how to download Terracotta and use the Welcome application.

h3. The Console Interface

When not connected to a server, the console displays a connect/disconnect panel, message-log window, status line, and an inactive cluster node in the clusters panel.

!AdminConsole.png|thumbnail, vspace=8!

The cluster list in the clusters panel could already be populated because of pre-existing references to previously defined Terracotta clusters. These references are maintained as Java properties and persist across sessions and product upgrades. If no clusters have been defined, a default cluster (host=localhost, jmx-port=9520) is created.

{info:title=Setting a JMX Port}
To learn more about setting JMX ports, see the [Configuration Guide and Reference|Configuration Guide and Reference#jmx-port].

Once the console is connected to a cluster, the cluster node in the clusters panel serves as the root of an expandable/collapsible tree with nested displays and controls. More than one cluster node can appear in the clusters panel.

h3. Menus

The following menus are available from the console's menu bar.

h5. File
* New Cluster -- Create a new cluster node in the clusters panel.
* Quit -- Shut down the console application. Has no effect on the cluster except to reduce load if the console has been recording statistics or profiling locks.

h5. Tools
* Show SVT -- Opens the Terracotta [#Snapshot Visualization Tool].
* Options -- Opens the [Options dialog|#OptionsDialog].

h5. Help
* Developer Console Help -- Go to the Developer Console documentation.
* Visit Terracotta Forums -- Go to the community forums to post questions and search for topics.
* Contact Terracotta Technical Support -- Go to the contact page for Terracotta technical support.
* Check for Updates -- Automatically check for updates to Terracotta.
* Check Server Version -- Automatically check for console-server version mismatch.
* About Terracotta Developer Console -- Display information on Terracotta and the local host.

h3. Context-Sensitive Help

Context-sensitive help is available wherever !Admin Console Guide^HelpButton.png! (help button) appears in the Terracotta Developer Console. Click !Admin Console Guide^HelpButton.png! in a console panel to open a web-browser page containing help on the features in that panel.

h3. Context Menus
Some console features have a context menu that is accessed by right-clicking the feature. For example, to open a context menu for creating a new cluster root in the clusters panel, right-click in the clusters panel. 

h2. Working with Clusters
!ConsoleClusterExample.png|align=right, hspace=8!

Clusters are the highest-level nodes in the expandable cluster list displayed by the Terracotta Developer Console. A single Terracotta cluster defines a domain of Terracotta server instances and clients (application servers) being clustered by Terracotta. A single Terracotta cluster can have one or more servers and one or more clients. For example, two or more Terracotta servers configured as a server array, along with their clients, appear under the same cluster.

h3. Adding and Removing Clusters

To add a new cluster reference, choose *New cluster* from the *File* or context menu.

The cluster topology is determined from the server specified in the connection panel's *Server Host* and *JMX Port* fields. These fields are editable when the console is not connected to the cluster.

To remove an existing cluster reference, right-click the cluster in the cluster list to open the context menu, then choose *Delete*.

h3. Connecting to a cluster
To connect to an existing cluster, select the cluster node in the cluster list, then click the *Connect* button in the connect/disconnect panel. You can also connect to a specific cluster by choosing *Connect* from its context menu. After a successful connection, the cluster node becomes expandable and a connection message appears in the status bar.

!AdminConsoleConnected.png|thumbnail, vspace=8!

To automatically connect to a cluster whenever the Terracotta Developer Console starts or when at least one of the cluster's servers is running, enable *Auto-connect* in the cluster context menu. Automatic connections are attempted in the background and do not interfere with normal console operation.

h3. Connecting to a Secured Cluster
A Terracotta cluster can be secured for JMX access, requiring authentication before access is granted. Connecting to a secured cluster prompts users to enter a username and password.

!AuthLogin.png| vspace=8!

For instructions on how to secure your Terracotta cluster for JMX, see the [Configuration Guide and Reference|Configuration Guide and Reference#server-authentication].

h3. Disconnecting from a Cluster
To disconnect from a cluster, select that cluster's node in the on the clusters panel and either click the *Disconnect* button above the help panel or select *Disconnect* from the cluster context menu.

h2. Working with Terracotta Server Arrays

Terracotta servers are arranged in _mirror groups_, each of which contains at least one active server instance. A high-availability mirror group also contains one backup server instance, sometimes called a passive server or "hot standby." Under the *Topology* node, a *Server Array* node contains all of the mirror groups in the cluster.

To view a table of mirror groups with their group IDs, expand the *Topology* node, then click *Server Array*.

!ConsoleMirrorGroups.png|thumbnail, vspace=8!

To view a table of the servers in a mirror group, expand the *Server Array* node, then click the mirror group whose servers you want to display. The table of servers includes each server's status and name, hostname or IP address, and JMX port.

!AdminConsoleServersTable.png|thumbnail, vspace=8!

To view the servers' nodes under a mirror-group node, expand the mirror-group node.

{anchor:server panel}
h3. Server Panel

Selecting a specific server's node displays that server's panel, with the *Main*, *Environment*, *Config* , and *Logging Settings* tabs.

The *Main* tab displays the server status and a list of properties, including the server's IP address, version, license, and persistence and failover modes. 

!AdminConsoleServerPanelMain.png|thumbnail, vspace=8!

The *Environment* tab displays the server's JVM system properties and provides a case-sensitive *Find* tool.

!AdminConsoleServerPanelEnvironment.png|thumbnail, vspace=8!

The *Config* tab displays the Terracotta configuration the server is using and provides a case-sensitive *Find* tool.

!AdminConsoleServerPanelConfig.png|thumbnail, vspace=8!

The *Logging Settings* tab displays logging options, each of which reports on data captured in five-second intervals:

* FaultDebug -- Logs the types of objects faulted from disk and the number of faults by type.
* RequestDebug -- Logs the types of objects requested by clients and the number of requests by type.
* FlushDebug -- Logs the types of objects flushed from clients and a count of flushes by type.
* BroadcastDebug -- Logs the types of objects that changed and caused broadcasts to other clients, and a count of those broadcasts by type.
* CommitDebug -- Logs the types of objects committed to disk and a count of commits by type.

h3. Connecting and Disconnecting from a Server

The Terracotta Developer Console connects to a cluster through one of the cluster's Terracotta servers. Being connected to a server means that the console is listening for JMX events coming from that server.

If you have confirmed that a Terracotta server is running, but the Terracotta Developer Console is unable to connect to it, a firewall on your network could be blocking the server's JMX port.

The console is disconnected from a cluster's servers when it's disconnected from the cluster. The console is also disconnected from a server when that server is shut down, even though the server may still appear in the console as part of the cluster. A server's [connection status|#server status] is indicated by its [status light|#server status].

Note that disconnecting from a server does not shut the server down or alter its status in the cluster. Servers can be shut down using the [stop-tc-server script|Tools Overview#start-tc-server].

A server shutdown button is available in the [Terracotta Operations Center].

{anchor:server status}
h3. Server Connection Status

A Terracotta server's connection status is indicated by a status light next to the server's name. The light's color indicates the server's current connection status. A cluster can have one server, or be configured with multiple servers that communicate state over the network or use a shared file-system.

The following table summarizes the connection status lights.

|| Status Light || Server Status || Notes ||
| *{color:green}GREEN{color}* | Active | The server is connected and ready for work. |
| *{color:red}RED{color}* | Unreachable | The server, or the network connection to the server, is down. |
| *{color:yellow}YELLOW{color}* | Starting or Standby | A server is starting up; in a disk-based multi-server cluster, a passive server goes into standby mode until a file lock held by the active server is released. |
| *{color:orange}ORANGE{color}* | Initializing | In a network-based multi-server cluster, a passive server must initialize its state before going into standby mode. |
| *{color:cyan}CYAN{color}* | Standby | In a network-based multi-server cluster, a passive server is ready to become active if the active server fails. |

h2. Working with Clients

Terracotta clients that are part of the cluster appear under the *Connected clients* node. To view the *Connected clients* node, expand the *Topology* node. The *Connected clients* panel displays a table of connected clients. The table has the following columns:

* Host - The client machine's hostname.
* Port - The client's DSO Port.
* ClientID - The client's unique ID number.
* Live Objects - The number of shared objects currently in the client's heap.

!AdminConsoleClients.png|thumbnail, vspace=8!

To view the client nodes that appear in the *Connected clients* panel, expand the *Connected clients* node.

h3. Client Panel
Selecting a specific client's node displays that client's panel, with the *Main*, *Environment*, *Config*, and *Logging* tabs.

The *Main* tab displays a list of client properties such as hostname and DSO port. 

!AdminConsoleClientPanelMain.png|thumbnail, vspace=8!

The *Environment* tab displays the client's JVM system properties and provides a case-sensitive *Find* tool.

!AdminConsoleClientPanelEnvironment.png|thumbnail, vspace=8!

The *Config* tab displays the Terracotta configuration the client is using and provides a case-sensitive *Find* tool.

!AdminConsoleClientPanelConfig.png|thumbnail, vspace=8!

The *Logging* tab displays options to add logging items corresponding to DSO client debugging. See the [Configuration Guide and Reference|Configuration Guide and Reference#debugging] for details on the various debug logging options.

!AdminConsoleClientPanelLogging.png|thumbnail, vspace=8!

h3. Connecting and Disconnecting Clients

When started up properly, a Terracotta client is automatically added to the appropriate cluster.

When a Terracotta client is shut down or disconnects from a server, that client is automatically removed from the cluster and no longer appears in the Terracotta Developer Console	.

A client disconnection button is available in the [Terracotta Operations Center].

h2. Monitoring Clusters, Servers, and Clients

The Terracotta Developer Console provides visual monitoring functions using dials, icons, graphs, statistics, counters, and both simple and nested lists. You can use these features to monitor the immediate and overall health of your cluster as well as the health of individual cluster components.

h3. Shared Objects

Applications clustered with Terracotta use shared objects to keep data coherent. Monitoring shared objects serves as an important early-warning and troubleshooting method that allows you to:

* Confirm that appropriate object sharing is occurring; 
* be alerted to potential memory issues; 
* learn when it becomes necessary to tune garbage collection;
* locate the source of object over-proliferation.

The Terracotta Developer Console provides the following tools for monitoring shared objects:

* [Object Browser|#Roots]
* [Classes browser|#Classes]
* [Object Flush and Fault Rate graphs|#fault flush graphs]
* [Cache Miss Rate Graph|#cache miss rate graph]
* [Runtime logging|#runtime logging]

These tools are discussed in the following sections.

h4. Object Browser
The Object Browser is a panel displaying shared object graphs in the cluster. To view the Object Browser, expand the *Clustered heap* node, then click the *Object browser* node.

The Object Browser does not refresh automatically. You can refresh it manually in any of the following ways:

* Expand or collapse any part of any object graph.
* Press the F5 key on your keyboard.
* Right-click any item on the object graph that has an object ID (for example, @1001), then select *Refresh* from the context menu.

The following are important aspects of the object graph display:

* The top-level objects in an object graph correspond to the shared roots declared in the Terracotta server's configuration file.
* Objects referencing other objects can be expanded or collapsed to show or hide the objects they reference.
* Objects in the graph that are a collections type, and reference other objects, indicate the number of their child elements currently being displayed.
This number is given as a ratio in the the format {{\[X/Y\]}}, where X is the number of child elements being displayed and Y is the total number of child elements in the collection. Collections also have *More* and *Less* items in their context menus for manual control over the number of child elements displayed.
* By default, up to ten children (fields) are displayed when you expand a collections-type object in the object graph.
Right-click a collections-type object to open a context menu and set the number of children displayed when that object is expanded. 
A delay can occur when the object browser attempts to display very large graphs.
* An object linked to a parent object is indicated by an up-arrow instead of a yellow diamond for a bullet.

h5. Cluster Object Browsing
To browse the shared-object graphs for the entire cluster, select *Cluster Heap* from the *Select View* menu. All of the shared objects in the cluster-wide heap are graphed, but the browser doesn't indicate which clients are sharing them. To see object graphs specific to a client, see [#Client Object Browsing].


The browser panel displays a running total of the live objects in the cluster. This is the number of objects currently found in the cluster-wide heap; however, this total does not correspond to the number of objects you see in the object graph because certain objects, including literals such as strings, are not counted. These uncounted objects appear in the object graph without an object ID.

An object ID appears with the format @<integer>. For example, @1001 can be an object ID.

Each element in an object graph has the following format:
fully.qualified.name.of.object (fully.qualified.name.of.object.type) [<number of subelements shown>/<total number of subelements>] [@<object ID>]

{anchor:client roots}
h5. Client Object Browsing

The client object browser is a panel displaying the shared object graphs for a single client. All of the shared objects known to the client are graphed, but the ones not being shared by the client are grayed out.


To open the client object browser, click *Client object browser* under a client node. The browser panel displays a running total of the live objects in the client. This is the number of objects currently found in the client heap; however, this total does not correspond to the number of objects you see in the object graph because the following types of objects are not counted:

* Objects _not_ being shared by the client 
These unshared objects are grayed out in the object-browser view.
* Literals such as strings
These objects appear in the object graph without an object ID.

Each element in an object graph has the following format:
fully.qualified.name.of.object (fully.qualified.name.of.object.type) [<number of subelements shown>/<total number of subelements>] [@<object ID]

h4. Classes Browser

DSO allows for transparent, clustered object state synchronization.  To accomplish this feature, some of your application classes will be adapted into new classes that are cluster-aware.  The set of all such adapted classes known to the server are displayed in the *Classes* panel.  The *Tabular* tab show all the adapted classes in a spreadsheet view, including the class name and a count of the number of instances of the class that have been created since the server started.  The *Tree* tab shows a hierarchical, or Java package, view of the adapted classes.  Finally, the *TreeMap* tab shows a presentation making it easy to quickly distinguish the most (and least) heavily used adapted classes.  These views are a snapshots of the adapted classes known to the server.  You can refresh these values by selecting the *Refresh* context menu on the *Classes* node.

!AdminConsoleClasses.png|thumbnail, vspace=8!

{anchor:fault flush graphs}
h5. Object Flush and Fault Rate Graphs

Object flush and fault rates are a measure of shared data flow between Terracotta servers and clients. These graphs can reflect trends in the flow of shared objects in a Terracotta cluster. Upward trends in flow can indicate insufficient heap memory, poor locality of reference, or newly changed environmental conditions. For more information, see [Object Flush Rate|#ObjectFlushRate] and [Object Fault Rate|#ObjectFaultRate].

{anchor:cache miss rate graph}
h5. Cache Miss Rate Graph

The Cache Miss Rate measures the number of client requests for an object that cannot be met by a server's cache and must be faulted in from disk. An upward trend in this graph can expose a bottleneck in your cluster. For more information, see [Cache Miss Rate|#CacheMissRate].

{anchor:runtime logging}
h5. Runtime Logging of New Shared Objects

You can log the creation of all new shared objects by following these steps:

# Select the target client in the cluster list.
# Click the *Logging* tab.
# Enable *New object debug* from the Runtime list.

During development or debugging operations, logging new objects can reveal patterns that introduce inefficiencies or errors into your clustered application. However, during production it is recommended that this type of intensive logging be disabled.

See the [Configuration Guide and Reference|Configuration Guide and Reference#debugging] for details on the various debug logging options.

h3. Runtime Statistics
Runtime statistics provide a continuous feed of sampled real-time data on a number of server and client metrics. The data is plotted on a graph with configurable polling and historical periods. Sampling begins automatically when a runtime statistic panel is first viewed, but historical data is not saved. To record and save historical data, see the [Cluster Statistics Recorder|#ClusterStatisticsRecorder].

!Admin Console Guide^AdminConsoleServerStats.png|thumbnail, vspace=8!

Each runtime statistics panel has the following controls:

* Select View -- Set to one of the following views:
** Aggregate View -- Choose *Aggregate Server Stats* to display cluster-wide statistics.
** Per-Client View -- Choose a client to display runtime statistics for that client.
** Per-Server View -- Choose a server to display runtime statistics for that server.

h4. Aggregate Server Stats

To view runtime statistics for every server and client in a cluster in one panel, click *Cluster runtime stats* under that cluster in the cluster list.

!Admin Console Guide^AdminConsoleClusterStats.png|thumbnail!

To adjust the poll and history periods, choose Options from the Tools menu. In the Options dialog, adjust the values in the polling and history fields.

Specific runtime statistics are defined in the following sections. The cluster components for which the statistic is available are indicated in parentheses.

h5. Heap Usage (Cluster, Server, Client)
Shows the amount, in megabytes, of maximum available heap and heap being used.

h5. CPU Usage (Cluster, Server, Client)
Shows the CPU load as a percentage. If more than one CPU is being used, each CPU's load is shown in a separate graph line.

h5. Transaction Rate (Cluster, Server, Client)
Shows the number of completed Terracotta transactions. [Terracotta transactions|Concept and Architecture Guide#Transactions] are sets of one or more clustered object changes, or writes, that must be applied atomically. 

Some statistics available through the Terracotta Developer Console are abouts [Terracotta transactions|Concept and Architecture Guide#Transactions]. Terracotta transactions are not application transactions. One Terracotta transaction is a batch of one or more writes to shared data. See the [Concept and Architecture Guide] for more information.

h5. Cache Miss Rate (Server)
Disk-to-server faults occur when an object is not available in a server's in-memory cache. The Cache Miss Rate statistic is a measure of how many objects (per-second) are being faulted from the disk in response to client requests. Objects being requested for the first time, or objects that have been flushed from the server heap before a request arrives, must be faulted in from disk. A high Cache Miss Rate could indicate inadequate memory allocation at the server.

h5. Unacknowledged Transaction Broadcasts (Client)
Every [Terracotta transactions|Concept and Architecture Guide#Transactions] in a Terracotta cluster must be acknowledged by Terracotta clients with in-memory shared objects that are affected by that transaction. For each client, Terracotta server instances keep a count of transactions that have not been acknowledged by that client. The Unacknowledged Transaction Broadcasts statistic is a count of how many transactions the client has yet to acknowledge. An upward trend in this statistic indicates that a client is not keeping up with transaction acknowledgments, which can slow the entire cluster. Such a client may need to be disconnected.

h5. Object Flush Rate (Server, Client)
The Object Flush Rate statistic is a measure of how many objects are being flushed out of client memory to the Terracotta server. These objects are available in the Terracotta server if needed at a later point in time. A high flush rate could indicate inadequate memory allocation at the client.

On a server, the Object Flush Rate is a total including all clients. On a client, the Object Flush Rate indicates only the objects that client is flushing.

h5. Object Fault Rate (Server, Client)
The Object Fault Rate statistic is a measure of how many objects are being faulted into client memory from the server. A high fault rate could indicate poor locality of reference or inadequate memory allocation at the client.

On a server, the Object Fault Rate is a total including all clients. On a client, the Object Fault Rate indicates only the objects that have been faulted to it.

When the Terracotta server faults an object, it also faults metadata for constructing a certain number of the objects referenced by or related to that object. This improves locality of reference. See the definition of the [fault-count property in Terracotta Configuration Guide and Reference|Configuration Guide and Reference#fault count] for more information.

h3. Lock profiler
The Terracotta runtime system can be directed to gather statistics about the distributed locks that are realized as a result of the configuration you have created.  Using these statistics can give you insight into the nature of your DSO application, letting you discover the code paths leading to highly-contented access to shared state.

The Lock Profiler panel lets you enable/disable lock statistics gathering, specify the lock code path trace depth for those statistics, and query the server to refresh the stats display.

Gathering and recording statistics can impact a cluster's performance. If statistics are being gathered, you are alerted in the cluster list by a flashing icon next to the affected cluster.

Getting started with lock statistics:

* Navigate to the Locks stats panel by clicking the _Lock stats_ node in the main navigation tree
* Enable statistics gathering by clicking the _On_ button
* Optionally set the desired _trace depth_ (default=0)
* Wait some period of time for some stats to be gathered and transmitted to the server
* Click the _Refresh_ button to update the display

The Locks Profiler panel is comprised of the _Client_ and _Server_ stats pages.

!Admin Console Guide^AdminConsoleLocks.png|thumbnail, vspace=8!

The client locks stats are based on the code paths in your DSO client applications that resulted in a lock being taken out.  The Server page stats concern the cluster-wide nature of the distributed locks. Each lock has a corresponding identifier, the lock-id.  For a named lock the lock-id is the lock name.  For an autolock the lock-id is the server-generated id of the object on which that lock was taken out.  An example of an autolock id is @1001.  That autolock id corresponds to the shared object upon which distributed synchronization was carried out.  You can use the [object browser|#Roots] to view the state of shared object @1001.

A single lock-expression in the configuration can result in the creation of multiple locks by the use of wildcard patterns.  A single lock can be arrived at through any number of different code paths.  A trace depth of zero means that you don't care how the lock was arrived at, but by increasing the trace depth the client-side lock stats are broken out by the corresponding number of Java call-stack frames. For example, there could be 3 different call sequences that result in a particular lock being granted, with one of the paths rarely entered and another responsible for the majority of those lock grants.  By setting the trace depth appropriately you can gain insight into the behavior of your application and how it can affect the performance of your clustered system.  Note that trace stack frames will only include Java source line numbers if the code was compiled with debugging enabled, commonly done by passing the javac command the -g flag and in Ant by defining the javac task with the debug="true" attribute.

h4. The Main Controls

h5. Enable Lock Profiling
Use this control to turn lock profiling on or off.

h5. Trace Depth
The trace depth control sets the number of client call-stack frames that are analyzed per lock event to record lock statistics.  A depth of 0 gathers lock statistics without regard to how the lock event was arrived at.

A lock depth of 1 means that one call-stack frame will be used to disambiguate different code paths when the lock event occurred.  A lock depth of 2 will use two frames, and so on.  So for example, with a setting of 1, all locks will appear be recorded together, regardless of the call path, because the stack depth analyzed will always be just the method that resulted in the lock event to occur (in other words the surrounding method).  However, beginning with a lock depth of 2, different call paths can be separated, since not only the surrounding method, but also the calling method, will be used to record different lock statistics.

This means that for example, when the trace depth setting is set to 1, a lock event that occurs within method Foo() will record all lock events occurring within Foo() as one single statistic, e.g. the number of lock requests, average held time and so on.  But, with a trace depth setting of 2, the callers of Foo(), say Bar1() and Bar2(), will also be considered, so that a call path of Bar1() -> Foo() will be recorded separately from Bar2() -> Foo().

h5. Refresh
Use this button to get an updated view of the statistics gathered so far.

h4. The Data Table
||Lock Statistic||Description||
|Times Requests|Number of times this lock was requested|
|Times Hopped|Times an acquired greedy lock was retracted from holding client and granted to another|
|Average Contenders|Average number of threads wishing to acquire this lock at the time it was requested|
|Average Acquire Time|Average time between lock request and grant|
|Average Held Time|Average time grantee held this lock|
|Average Nested Lock Depth|Average number of outstanding locks held by acquiring thread at grant time|

h4. Lock Element Details
The bottom portion of the _Clients_ page displays detail on the selected lock element.  The currently selected lock trace is shown on the left and the configuration element responsible for the creation of the selected lock is shown on the right.

A special note has to be made with respect to the Server lock stats. The Terracotta system employs the concept of *greedy locks* to help improve performance by limiting unnecessary lock hops. Once a client has been awarded a lock it is allowed to keep that lock until another client requests it.  The assumption is that once a client obtains a lock it will likely want to request that same lock again shortly.  So a lock is handed out to a client until such a time that a different client wants that lock.  So if your cluster consisted of a single node that manipulated a single shared object repeatedly, the Server lock requests would be 1 until another client entered the cluster and began manipulating that object.  It is likely that when you see Server stats that are undefined (na) it is due to the nature of greedy locks.

h3. Distributed Garbage Collection
Objects in a DSO root object graph can become unreferenced and no longer exist in the Terracotta client's heap. These objects are eventually marked as garbage in a Terracotta server instance's heap and from persistent storage by the Terracotta Distributed Garbage Collector (DGC). The DGC is unrelated to the Java garbage collector.

For more information on the DGC, see the [Terracotta Concept and Architecture Guide|Concept and Architecture Guide#dgc].

To view a history table of DGC activity in the current cluster, click *Distributed garbage collection* in the cluster list. The history table is automatically refreshed each time a collection occurs. Each row in the history table represents one distributed garbage collection cycle, with the following columns:

||Column ||Definition ||Values
|Iteration |The index number of the DGC cycle| Sequential integer|
|Type |The type of cycle |Full -- Running a full collection cycle targeting all eligible objects. 
Young -- Running a collection cycle targeting Young Generation objects. |
|Status |The collection cycle's current state |START -- Monitoring for object reference changes and collecting statistics such as the object begin count.
MARK -- Determining which objects should be collected and which should not.
PAUSE -- Determining if any marked objects should not be collected.
MARK COMPLETED -- Stops checking for reference changes (finalizing marked object list).
DELETE -- Deleting objects.
COMPLETE -- Completed cycle.|
|Start time |The date and time the cycle began |Date and time stamp (local server time) |
|Begin count |The total number of shared objects held by the server |Integer counter |
|Paused stage |The total time the DGC paused |Milliseconds |
|Mark stage |The total time the DGC took to mark objects for collection |Milliseconds |
|Garbage count |The number of shared objects marked for collection |Integer counter |
|Delete stage |The total time the DGC took to collect marked objects |Milliseconds |
|Total elapsed time |The total time the DGC took to pause, mark objects, and collect marked objects |Milliseconds |

h3. Thread Dumps
You can get a snapshot of the state of each server and client in the Terracotta cluster using the Terracotta Developer Console thread dumps feature. 

!Admin Console Guide^AdminConsoleThreadDumps.png|thumbnail!

Every Terracotta cluster, server, and client in the cluster list has a thread-dumps panel. Each panel has a list logging completed thread dumps, and a pane to display the contents of a selected thread dump. Each panel also provides a case-sensitive *Find* tool for searching through the currently displayed thread dump.

h4. Cluster Thread Dumps
!Admin Console Guide^AdminConsoleClusterThreadDumps.png|thumbnail, ivspace=8!

To generate, view, and save a cluster-wide thread dump:
# Expand the target cluster in the cluster list. 
# Click *Cluster thread dumps* to open the thread-dumps panel.
# Click *Take thread dump*.
The thread dump is logged in an expandable list.
# Expand an entry in the thread-dumps log to see the thread-dump subentries for each server and client. 
# Click a server or client subentry to display the thread dump for that server or client.
# To save a cluster-wide thread dump as a zip file, click *Export...*.

h4. Server Thread Dumps
!Admin Console Guide^AdminConsoleServerThreadDumps.png|thumbnail, vspace=8!

To generate and view a thread dump for any server process:
# Expand the target server in the cluster list. 
# Click *Server thread dumps* to open the thread-dumps panel.
# Click *Take thread dump*.
The thread dump is logged in a list. 
#Click the entry in the list to display the thread dump.

h4. Client Thread Dumps
!Admin Console Guide^AdminConsoleClientThreadDumps.png|thumbnail, vspace=8!

To generate and view a thread dump for any client process:
# Expand the target client in the cluster list. 
# Click *Client thread dumps* to open the thread-dumps panel.
# Click *Take thread dump*.
The thread dump is logged in a list. 
#Click the entry in the list to display the thread dump.

h2. Recording and Viewing Statistics

h3. Cluster Statistics Recorder
The *Cluster Statistics Recorder* panel can generate recordings of selected cluster-wide statistics. This panel has controls to start, stop, view, and export recording sessions. You can use the [#Snapshot Visualization Tool] to view the recorded information.


For definitions of available statistics, see [Cluster Statistics Definitions|#definitions]. To learn about configuring the Terracotta Cluster Statistics Recorder, using its command-line interface, and more, see the [Cluster Statistics Recorder Guide].

Gathering and recording statistics can impact a cluster's performance. If statistics are being gathered, you are alerted in the cluster list by a flashing icon next to the affected cluster.

h3. Snapshot Visualization Tool {anchor:svt}
The *Snapshot Visualization Tool* (SVT) provides a graphical view of cluster information and statistics. The view is created using data recorded with the Statistics Recorder.

!Admin Console Guide^svt.png|thumbnail, vspace=8!

The SVT is provided as a TIM, called tim-svt, which you can install from the [TIM Update Center|tim-get]. Once the SVT is installed, start (or restart) the Terracotta Developer Console and confirm that the *View* button on the Cluster Statistics Recorder is enabled. No changes to the Terracotta configuration file are necessary when you install the SVT. 

In Eclipse with the Terracotta DSO Eclipse plug-in, use the *Terracotta|Update modules...* menu to install SVT.

SVT controls are defined below.

h5. Import...

Load a saved cluster statistics recording that was saved to file. Clicking *Import...* opens a standard file-selection window for locating the file.

h5. Retrieve...
Find recorded sessions on active Terracotta servers. Clicking *Retrieve...* opens a dialog to enter the server address in the format <server_ip_address:JMX_port> or <server_name:JMX_port> as defined in {{tc-config.xml}}. Once connected to the server, available recorded sessions appear in the SVT *Sessions* menu.

h5. Sessions
Select a recorded session from the *Sessions* drop-down menu to load it. *Sessions* lists the recorded sessions last retrieved from a Terracotta server.

h5. Graph heights
Scale the y-axis on the graphs displayed in the SVT. Moving the slider to the left shrinks the graph height, while moving it to the right grows the graph height.

h5. Server, Client, and Statistics checkboxes
Choose which servers and clients have their recorded statistics displayed in the graphs. For each server and client, choose which statistics are displayed in the graphs.

h2. Backing Up Shared Data
The [Terracotta Operations Center] provides console-based backup configuration. Enterprise versions of Terracotta also include a [backup script|Tools Overview#backup].

h2. Update Checker
On a bi-weekly basis the Terracotta Developer Console will check, when first started, on updates to the Terracotta platform. By default, a notice informing you that an update check is about to be performed is displayed, allowing to ignore the immediate check, acknowledge and allow the check, or to disable further checking.

!Admin Console Guide^AdminConsoleUpdateChecker.png|thumbnail, vspace=8!

Should the update check be allowed, the Terracotta Developer Console will query the OpenTerracotta website (www.terracotta.org) and report on any new updates. Should the update checker feature be disabled, it can always be re-enabled via the *Help|Update Checker...* menu.

h2. More Information

More information on the following topics is available in other Terracotta documentation:

* [JMX Port|Configuration Guide and Reference#jmx-port]
* [Roots|Concept and Architecture Guide#roots]
* [Distributed Garbage Collection|Concept and Architecture Guide#DistributedGarbageCollection]
* [Object Portability|Concept and Architecture Guide#portability]

h2. Appendix: Definitions of Cluster Statistics

The following categories of cluster information and statistics are available for viewing and recording in the [Terracotta Cluster Statistics Recorder|#ClusterStatisticsRecorder].

l1 = Terracotta client
l2 = Terracotta server instance
See the [Glossary|Glossary] for definitions of commonly used terms.

h5. cache objects evict request
The total number of objects marked for eviction from the l1, or from the l2 to disk. Evicted objects are still referenced, and can be faulted back to the l1 from the l2 or from disk to l2. The SVT graphs this metric for each l1 and l2 separately. High counts imply that free memory could be low.

h5. cache objects evicted
The number of objects actually evicted. If this metric is not close in value to _cache objects evict request_, then memory may not be getting freed quickly enough.

h5. l1 l2 flush
The object flush rate when the l1 flushes objects to the l2 to free up memory or as a result of GC activity.

h5. l2 faults from disk
The number of times the l2 has to load objects from disk to serve l1 object demand. A high faulting rate could indicate an overburdened l2.

h5. l2 l1 fault
The number of times an l2 has to send objects to an l1 because the objects do not exist in the l1 local heap due to memory constraints. Better scalability is achieved when this number is lowered through improved locality and usage of an optimal number of JVMs.

h5. memory (usage)
The amount of memory (heap) usage over time.

h5. vm garbage collector
The standard Java garbage collector's behavior, tracked on all JVMs in the cluster.

h5. distributed gc (distributed garbage collection, or DGC)
The behavior of the Terracotta tool that collects distributed garbage on an l2. The DGC can pause all other work on the l2 to ensure that no referenced objects are flagged for garbage collection.

h5. l2 pending transactions
The number of [Terracotta transactions|Concept and Architecture Guide#Transactions] held in memory by a Terracotta server instance for the purpose of minimizing disk writes. Before writing the pending transactions, the Terracotta server instance optimizes them by folding in redundant changes, thus reducing its disk access time. Any object that is part of a pending transaction cannot be changed until the transaction is complete.

h5. stage queue depth
The depth to which visibility into Terracotta server-instance work-queues is available. A larger depth value allows more detail to emerge on pending task-completion processes, bottlenecks due to application requests or behavior, types of work being done, and load conditions. Rising counts (of items in these processing queues) indicate backlogs and could indicate performance degradation.

h5. server transaction sequencer stats
Statistics on the Terracotta server-instance transaction sequencer, which sequences transactions as resources become available while maintaining transaction order.

h5. network activity
The amount of data transmitted and received by a Terracotta server instance in bytes per second.

h5. l2 changes per broadcast

The number of updates to objects per broadcast message (see [l2 broadcast count|#l2 broadcast count]).

h5. message monitor
The network message count flowing over TCP from Terracotta clients to the Terracotta server.

h5. l2 broadcast count
The number of times that a Terracotta server instance has transmitted changes to objects. This "broadcast" occurs any time the changed object is resident in more than one Terracotta client JVM. This is not a true broadcast since messages are sent only to clients where the changed objects are resident.

h5. l2 transaction count 
The number of [Terracotta transactions|Concept and Architecture Guide#Transactions] being processed (per second) by a Terracotta server instance.

h5. l2 broadcast per transaction
The ratio of broadcasts to [Terracotta transactions|Concept and Architecture Guide#Transactions]. A high ratio (close to 1) means that each broadcast is reporting few transactions, and implies a high co-residency of objects and inefficient distribution of application data. A low ratio (close to 0) reflects high locality of reference and better options for linear scalability.

h5. system properties
Snapshot of all Java properties passed in and set at startup for each JVM. Used to determine configuration states at the time of data capture, and for comparison of configuration across JVMs.

h5. thread dump
Displays a marker on all statistics graphs in the SVT at the point when a thread dump was taken using the _Cluster statistics recorder_. Clicking the marker displays the thread dump.

h5. disk activity
The number of operations (reads and writes) per second, and the number of bytes per second (throughput). The number of reads corresponds to l2 faulting objects from disk, while writes corresponds to l2 flushing objects to disk. The SVT graphs the two aspects separately.

h5. cpu (usage)
The percent of CPU resources being used. Dual-core processors are broken out into CPU0 and CPU1.