@Statistics — Returns statistics about the usage of the VoltDB database.
@Statistics String component, Integer delta-flag
The @Statistics system procedure returns information about the VoltDB database. The second argument, component, specifies what aspect of VoltDB to return statistics about. The third argument, delta-flag, specifies whether statistics are reported from when the database started or since the last call to @Statistics where the flag was set.
If the delta-flag is set to zero, the system procedure returns statistics since the database started. If the delta-flag is non-zero, the system procedure returns statistics for the interval since the last time @Statistics was called with a non-zero flag. (If @Statistics has not been called with a non-zero flag before, the first call with the flag set returns statistics since startup.)
Note that in a cluster with K-safety, if a node fails, the statistics reported by this procedure are reset to zero for the node when it rejoins the cluster.
The following are the allowable values of component:
Returns information about the amount of CPU used by each VoltDB server process. CPU usage is returned as a number between 0 and 100 representing the amount of CPU used by the VoltDB process out of the total CPU available for that server.
Returns information about the status of database replication, including how much data is waiting to be sent to the DR agent. This information is available only if the database is licensed for database replication.
Returns information about the indexes in the database, including the number of keys for each index and the estimated amount of memory used to store those keys. Separate information is returned for each partition in the database.
Returns information on the number of procedure invocations for each stored procedure (including system procedures). The count of invocations is reported for each connection to the database.
Returns information on the number of messages and amount of data (in bytes) sent to and from each connection to the database.
Returns information about the number of outstanding requests per client. You can use this information to determine how much work is waiting in the execution queues.
Returns the same information as INDEX, INITIATOR, IOSTATS, MEMORY, PROCEDURE, and TABLE, except all in a single procedure call.
Returns statistics on the use of memory for each node in the cluster. MEMORY statistics include the current resident set size (RSS) of the VoltDB server process; the amount of memory used for Java temporary storage, database tables, indexes, and string (including varbinary) storage; as well as other information.
Returns information on the number of unique partitions in the cluster. The VoltDB cluster creates multiple partitions based on the number of servers and the number of sites per host requested. So, for example, a 2 node cluster with 4 sites per host will have 8 partitions. However, when you define a cluster with K-safety, there are duplicate partitions. PARTITIONCOUNT only reports the number of unique partitions available in the cluster.
Returns information on the use of cached plans within each partition. Queries in stored procedures are planned when the application catalog is compiled. However, ad hoc queries must be planned at runtime. To improve performance, VoltDB caches plans for ad hoc queries so they can be reused when a similar query is encountered later. There are two caches: the level 1 cache performs exact matches on queries and the level 2 cache parameterizes constants so it can match queries with the same plan but different input. The planner statistics provide information about the size of each cache, how frequently it is used, and the minimum, maximum, and average execution time of ad hoc queries as a result.
Returns information on the usage of stored procedures for each site within the database cluster sorted by partition. The information includes the name of the procedure, the number of invocations (for each site), and selected performance information on minimum, maximum, and average execution time.
Returns summary information on the size of the input data submitted with stored procedure invocations. PROCEDUREINPUT uses information from PROCEDURE, except it focuses on the input parameters and aggregates data for the entire cluster.
Returns summary information on the size of the result sets returned by stored procedure invocations. PROCEDUREOUTPUT uses information from PROCEDURE, except it focuses on the result sets and aggregates data for the entire cluster.
Returns summary information on the usage of stored procedures averaged across all partitions in the cluster. The information from PROCEDUREPROFILE is similar to the information from PROCEDURE, except it focuses on the performance of the individual procedures rather than on procedures by partition. The weighted average across partitions is helpful for determining which stored procedures the application is spending most of its time in.
Returns information on the current progress of rebalancing on the cluster. Rebalancing occurs when one or more nodes are added "on the fly" to an elastic cluster. If no rebalancing is occurring, no data is returned. During a rebalance, this selector returns information about the speed of migration of the data, the latency of rebalance tasks, and the estimated time until completion.
For rebalance, the delta flag to the system procedure is ignored. All rebalance statistics are cumulative for the current rebalance activity.
Returns information about up to ten of the most recent snapshots performed by the database. The results include the directory path and prefix for the snapshot, when it occurred, how long it took, and whether the snapshot was completed successfully or not. The results report on both native and CSV snapshots, as well as manual, automated, and command log snapshots. Note that this selector does not tell you whether the snapshot files still exist, only that the snapshot was performed. Use the @SnapshotScan procedure to determine what snapshots are available.
Returns information about the database tables, including the number of rows per site for each table. This information can be useful for seeing how well the rows are distributed across the cluster for partitioned tables.
Note that INITIATOR and PROCEDURE report information on both user-declared stored procedures and system procedures. These include certain system procedures that are used internally by VoltDB and are not intended to be called by client applications. Only the system procedures documented in this appendix are intended for client invocation.
Returns different VoltTables depending on which component is requested. The following tables identify the structure of the return values for each component. (Note that the MANAGEMENT component returns seven VoltTables.)
CPU — Returns a row for every server in the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
PERCENT_USED | BIGINT | The percentage of total CPU available used by the database server process. |
DR — Returns two VoltTables. The first table contains information about the replication streams, which consist of a row per partition for each server. The data shows the current state of replication and how much data is currently queued for the DR agent.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
PARTITION_ID | INTEGER | The numeric ID for the logical partition. |
STREAMTYPE | STRING | The type of stream, which can either be "TRANSACTIONS" or "SNAPSHOT". |
TOTALBYTES | BIGINT | The total number of bytes currently queued for transmission to the DR agent. |
TOTALBYTESINMEMORY | BIGINT | The total number of bytes of queued data currently held in memory. If the amount of total bytes is larger than the amount in memory, the remainder is kept in overflow storage on disk. |
TOTALBUFFERS | BIGINT | The total number of buffers in this partition currently waiting for acknowledgement from the DR agent. Partitions create a buffer every five milliseconds. |
LASTACKTIMESTAMP | BIGINT | The timestamp of the last acknowledgement received from the DR agent. |
ISSYNCED | STRING | A text string indicating whether the database is currently being replicated. If replication has not started, or the overflow capacity has been exceeded (that is, replication has failed), the value of ISSYNCED is "false". If replication is currently in progress, the value is "true". |
MODE | STRING | A text string indicating whether this particular partition is replicating data for the DR agent ("NORMAL") or not ("PAUSED"). Only one copy of each logical partition actually sends data to the DR agent during replication. So for clusters with a K-safety value greater than zero, not all physical partitions will report "NORMAL" even when replication is in progress. |
The second table returns a row for every host in the cluster, showing whether a replication snapshot is in progress and if it is, the status of transmission to the DR agent.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
ENABLED | STRING | A text string indicating whether the database is currently being replicated. Possible values are "true" and "false". |
SYNCSNAPSHOTSTATE | STRING | A text string indicating the current state of the synchronization snapshot that begins replication. During normal operation, this value is "NOT_SYNCING" indicating either that replication is not active or that transactions are actively being replicated. If a synchronization snapshot is in progress, this value provides additional infomation about the specific activity underway. |
ROWSINSYNCSNAPSHOT | BIGINT | Reserved for future use. |
ROWSACKEDFORSYNCSNAPSHOT | BIGINT | Reserved for future use. |
INDEX — Returns a row for every index in every execution site.
Name | Datatype | Description | ||||
---|---|---|---|---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). | ||||
HOST_ID | BIGINT | Numeric ID for the host node. | ||||
HOSTNAME | STRING | Server name of the host node. | ||||
SITE_ID | BIGINT | Numeric ID of the execution site on the host node. | ||||
PARTITION_ID | BIGINT | The numeric ID for the logical partition that this site represents. When using a K value greater than zero, there are multiple copies of each logical partition. | ||||
INDEX_NAME | STRING | The name of the index. | ||||
TABLE_NAME | STRING | The name of the database table to which the index applies. | ||||
INDEX_TYPE | STRING | A text string identifying the type of the index as either a hash or tree index and whether it is unique or not. Possible values include the followiing:
| ||||
IS_UNIQUE | TINYINT | A byte value specifying whether the index is unique (1) or not (0). | ||||
IS_COUNTABLE | TINYINT | A byte value specifying whether the index maintains a counter to optimize COUNT(*) queries. | ||||
ENTRY_COUNT | BIGINT | The number of index entries currently in the partition. | ||||
MEMORY_ESTIMATE | INTEGER | The estimated amount of memory (in kilobytes) consumed by the current index entries. |
INITIATOR — Returns a separate row for each connection and the stored procedures initiated by that connection.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
SITE_ID | INTEGER | Numeric ID of the execution site on the host node. |
CONNECTION_ID | BIGINT | Numeric ID of the client connection invoking the procedure. |
CONNECTION_HOSTNAME | STRING | The server name of the node from which the client connection originates. |
PROCEDURE_NAME | STRING | The name of the stored procedure. |
INVOCATIONS | BIGINT | The number of times the stored procedure has been invoked by this connection on this host node. |
AVG_EXECUTION_TIME | INTEGER | The average length of time (in milliseconds) it took to execute the stored procedure. |
MIN_EXECUTION_TIME | INTEGER | The minimum length of time (in milliseconds) it took to execute the stored procedure. |
MAX_EXECUTION_TIME | INTEGER | The maximum length of time (in milliseconds) it took to execute the stored procedure. |
ABORTS | BIGINT | The number of times the procedure was aborted. |
FAILURES | BIGINT | The number of times the procedure failed unexpectedly. (As opposed to user aborts or expected errors, such as constraint violations.) |
IOSTATS — Returns one row for every client connection on the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
CONNECTION_ID | BIGINT | Numeric ID of the client connection invoking the procedure. |
CONNECTION_HOSTNAME | STRING | The server name of the node from which the client connection originates. |
BYTES_READ | BIGINT | The number of bytes of data sent from the client to the host. |
MESSAGES_READ | BIGINT | The number of individual messages sent from the client to the host. |
BYTES_WRITTEN | BIGINT | The number of bytes of data sent from the host to the client. |
MESSAGES_WRITTEN | BIGINT | The number of individual messages sent from the host to the client. |
LIVECLIENTS — Returns a row for every client connection currently active on the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
CONNECTION_ID | BIGINT | Numeric ID of the client connection invoking the procedure. |
CLIENT_HOSTNAME | STRING | The server name of the node from which the client connection originates. |
ADMIN | TINYINT | A byte value specifying whether the connection is to the client port (0) or the admin port (1). |
OUTSTANDING_REQUEST_BYTES | BIGINT | The number of bytes of data sent from the client currently pending on the host. |
OUTSTANDING_RESPONSE_MESSAGES | BIGINT | The number of messages on the host queue waiting to be retrieved by the client. |
OUTSTANDING_ TRANSACTIONS | BIGINT | The number of transactions (that is, stored procedures) initiated on behalf of the client that have yet to be completed. |
MEMORY — Returns a row for every server in the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
RSS | INTEGER | The current resident set size. That is, the total amount of memory allocated to the VoltDB processes on the server. |
JAVAUSED | INTEGER | The amount of memory (in kilobytes) allocated by Java and currently in use by VoltDB. |
JAVAUNUSED | INTEGER | The amount of memory (in kilobytes) allocated by Java but unused. (In other words, free space in the Java heap.) |
TUPLEDATA | INTEGER | The amount of memory (in kilobytes) currently in use for storing database records. |
TUPLEALLOCATED | INTEGER | The amount of memory (in kilobytes) allocated for the storage of database records (including free space). |
INDEXMEMORY | INTEGER | The amount of memory (in kilobytes) currently in use for storing database indexes. |
STRINGMEMORY | INTEGER | The amount of memory (in kilobytes) currently in use for storing string and binary data that is not stored "in-line" in the database record. |
TUPLECOUNT | BIGINT | The total number of database records currently in memory. |
POOLEDMEMORY | BIGINT | The total size of memory (in kilobytes) allocated for tasks other than database records, indexes, and strings. (For example, pooled memory is used for temporary tables while processing stored procedures.) |
PHYSICALMEMORY | BIGINT | The total size of physical memory (in kilobytes) on the server. |
PARTITIONCOUNT — Returns one row identifying the total number of partitions and the host that provided that information.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
PARTITION_COUNT | INTEGER | The number of unique or logical partitions on the cluster. When using a K value greater than zero, there are multiple copies of each logical partition. |
PLANNER — Returns a row for every planner cache. That is, one cache per execution site, plus one global cache per server. (The global cache is identified by a site and partition ID of minus one.)
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
SITE_ID | INTEGER | Numeric ID of the execution site on the host node. |
PARTITION_ID | INTEGER | The numeric ID for the logical partition that this site represents. When using a K value greater than zero, there are multiple copies of each logical partition. |
CACHE1_LEVEL | INTEGER | The number of query plans in the level 1 cache. |
CACHE2_LEVEL | INTEGER | The number of query plans in the level 2 cache. |
CACHE1_HITS | INTEGER | The number of queries that matched and reused a plan in the level 1 cache. |
CACHE2_HITS | INTEGER | The number of queries that matched and reused a plan in the level 2 cache. |
CACHE_MISSES | INTEGER | The number of queries that had no match in the cache and had to be planned from scratch |
PLAN_TIME_MIN | BIGINT | The minimum length of time (in nanoseconds) it took to complete the planning of ad hoc queries. |
PLAN_TIME_MAX | BIGINT | The maximum length of time (in nanoseconds) it took to complete the planning of ad hoc queries. |
PLAN_TIME_AVG | BIGINT | The average length of time (in nanoseconds) it took to complete the planning of ad hoc queries. |
FAILURES | BIGINT | The number of times planning for an ad hoc query failed. |
PROCEDURE — Returns a row for every stored procedure that has been executed on the cluster, grouped by execution site.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
SITE_ID | INTEGER | Numeric ID of the execution site on the host node. |
PARTITION_ID | INTEGER | The numeric ID for the logical partition that this site represents. When using a K value greater than zero, there are multiple copies of each logical partition. |
PROCEDURE | STRING | The class name of the stored procedure. |
INVOCATIONS | BIGINT | The total number of invocations of this procedure at this site. |
TIMED_INVOCATIONS | BIGINT | The number of invocations used to measure the minimum, maximum, and average execution time. |
MIN_EXECUTION_TIME | BIGINT | The minimum length of time (in nanoseconds) it took to execute the stored procedure. |
MAX_EXECUTION_TIME | BIGINT | The maximum length of time (in nanoseconds) it took to execute the stored procedure. |
AVG_EXECUTION_TIME | BIGINT | The average length of time (in nanoseconds) it took to execute the stored procedure. |
MIN_RESULT_SIZE | INTEGER | The minimum size (in bytes) of the results returned by the procedure. |
MAX_RESULT_SIZE | INTEGER | The maximum size (in bytes) of the results returned by the procedure. |
AVG_RESULT_SIZE | INTEGER | The average size (in bytes) of the results returned by the procedure. |
MIN_PARAMETER_SET_SIZE | INTEGER | The minimum size (in bytes) of the parameters passed as input to the procedure. |
MAX_PARAMETER_SET_SIZE | INTEGER | The maximum size (in bytes) of the parameters passed as input to the procedure. |
AVG_PARAMETER_SET_SIZE | INTEGER | The average size (in bytes) of the parameters passed as input to the procedure. |
ABORTS | BIGINT | The number of times the procedure was aborted. |
FAILURES | BIGINT | The number of times the procedure failed unexpectedly. (As opposed to user aborts or expected errors, such as constraint violations.) |
PROCEDUREINPUT — Returns a row for every stored procedure that has been executed on the cluster, summarized across the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
PROCEDURE | STRING | The class name of the stored procedure. |
WEIGHTED_PERC | BIGINT | A weighted average expressed as a percentage of the parameter set size for invocations of this stored procedure compared to all stored procedure invocations. |
INVOCATIONS | BIGINT | The total number of invocations of this procedure. |
MIN_PARAMETER_SET_SIZE | BIGINT | The minimum parameter set size in bytes. |
MAX_PARAMETER_SET_SIZE | BIGINT | The maximum parameter set size in bytes. |
AVG_PARAMETER_SET_SIZE | BIGINT | The average parameter set size in bytes. |
TOTAL_PARAMETER_SET_SIZE_MB | BIGINT | The total input for all invocations of this stored procedure measured in megabytes. |
PROCEDUREOUTPUT — Returns a row for every stored procedure that has been executed on the cluster, summarized across the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
PROCEDURE | STRING | The class name of the stored procedure. |
WEIGHTED_PERC | BIGINT | A weighted average expressed as a percentage of the result set size returned by invocations of this stored procedure compared to all stored procedure invocations. |
INVOCATIONS | BIGINT | The total number of invocations of this procedure. |
MIN_RESULT_SIZE | BIGINT | The minimum result set size in bytes. |
MAX_RESULT_SIZE | BIGINT | The maximum result set size in bytes. |
AVG_RESULT_SIZE | BIGINT | The average result set size in bytes. |
TOTAL_RESULT_SIZE_MB | BIGINT | The total output returned by all invocations of this stored procedure measured in megabytes. |
PROCEDUREPROFILE — Returns a row for every stored procedure that has been executed on the cluster, summarized across the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
PROCEDURE | STRING | The class name of the stored procedure. |
WEIGHTED_PERC | BIGINT | A weighted average expressed as a percentage of the execution time for this stored procedure compared to all stored procedure invocations. |
INVOCATIONS | BIGINT | The total number of invocations of this procedure. |
AVG | BIGINT | The average length of time (in nanoseconds) it took to execute the stored procedure. |
MIN | BIGINT | The minimum length of time (in nanoseconds) it took to execute the stored procedure. |
MAX | BIGINT | The maximum length of time (in nanoseconds) it took to execute the stored procedure. |
ABORTS | BIGINT | The number of times the procedure was aborted. |
FAILURES | BIGINT | The number of times the procedure failed unexpectedly. (As opposed to user aborts or expected errors, such as constraint violations.) |
REBALANCE — Returns one row if the cluster is rebalancing. No data is returned if the cluster is not rebalancing.
The rebalance selector is still under development. The return values are likely to change in upcoming releases.
Name | Datatype | Description |
---|---|---|
TOTAL_RANGES | BIGINT | The total number of partition segments to be migrated. |
PERCENTAGE_MOVED | FLOAT | The percentage of the total segments that have already been moved. |
MOVED_ROWS | BIGINT | The number of rows of data that have been moved. |
ROWS_PER_SECOND | FLOAT | The average number of rows moved per second. |
ESTIMATED_REMAINING | BIGINT | The estimated time remaining until the rebalance is complete, in milliseconds. |
MEGABYTES_PER_SECOND | FLOAT | The average volume of data moved per second, measured in megabytes. |
CALLS_PER_SECOND | FLOAT | The average number of rebalance work units, or transactions, executed per second. |
CALLS_LATENCY | FLOAT | The average execution time for rebalance transactions, in milliseconds. |
SNAPSHOTSTATUS — Returns a row for every snapshot file in the recent snapshots performed on the cluster.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the snapshot was initiated (in milliseconds). |
HOST_ID | INTEGER | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
TABLE | STRING | The name of the database table whose data the file contains. |
PATH | STRING | The directory path where the snapshot file resides. |
FILENAME | STRING | The file name. |
NONCE | STRING | The unique identifier for the snapshot. |
TXNID | BIGINT | The transaction ID of the snapshot. |
START_TIME | BIGINT | The timestamp when the snapshot began (in milliseconds). |
END_TIME | BIGINT | The timestamp when the snapshot was completed (in milliseconds). |
SIZE | BIGINT | The total size, in bytes, of the file. |
DURATION | BIGINT | The length of time (in milliseconds) it took to complete the snapshot. |
THROUGHPUT | FLOAT | The average number of bytes per second written to the file during the snapshot process. |
RESULT | STRING | String value indicating whether the writing of the snapshot file was successful ("SUCCESS") or not ("FAILURE"). |
TABLE — Returns a row for every table, per partition. In other words, the number of tables, multiplied by the number of sites per host and the number of hosts.
Name | Datatype | Description |
---|---|---|
TIMESTAMP | BIGINT | The timestamp when the information was collected (in milliseconds). |
HOST_ID | BIGINT | Numeric ID for the host node. |
HOSTNAME | STRING | Server name of the host node. |
SITE_ID | BIGINT | Numeric ID of the execution site on the host node. |
PARTITION_ID | BIGINT | The numeric ID for the logical partition that this site represents. When using a K value greater than zero, there are multiple copies of each logical partition. |
TABLE_NAME | STRING | The name of the database table. |
TABLE_TYPE | STRING | The type of the table. Values returned include "PersistentTable" for normal data tables and views and "StreamedTable" for export-only tables. |
TUPLE_COUNT | BIGINT | The number of rows currently stored for this table in the current partition. For export-only tables, the cumulative total number of rows inserted into the table. |
TUPLE_ALLOCATED_MEMORY | INTEGER | The total size of memory, in kilobytes, allocated for storing inline data associated with this table in this partition. The allocated memory can exceed the currently used memory (TUPLE_DATA_MEMORY). For export-only tables, this field identifies the amount of memory currently in use to queue export data (both in memory and as export overflow) prior to its being passed to the export target. |
TUPLE_DATA_MEMORY | INTEGER | The total memory, in kilobytes, used for storing inline data associated with this table in this partition. The total memory used for storing data for this table is the combination of memory used for inline (tuple) and non-inline (string) data. |
STRING_DATA_MEMORY | INTEGER | The total memory, in kilobytes, used for storing non-inline variable length data (VARCHAR and VARBINARY) associated with this table in this partition. The total memory used for storing data for this table is the combination of memory used for inline (tuple) and non-inline (string) data. |
TUPLE_LIMIT | INTEGER | The row limit for this table. Row limits are optional and are defined in the schema as a maximum number of rows that any partition can contain. If no row limit is set, this value is null. |
PERCENT_FULL | INTEGER | The percentage of the row limit currently in use by table rows in this partition. If no row limit is set, this value is zero. |
The following example uses @Statistics to gather information about the distribution of table rows within the cluster:
$ sqlcmd 1> exec @Statistics TABLE, 0;
The next program example shows a procedure that collects and displays the number of transactions (i.e. stored procedures) during a given interval, by setting the delta-flag to a non-zero value. By calling this procedure iteratively (for example, every five minutes), it is possible to identify fluctuations in the database workload over time (as measured by the number of transactions processed).
void measureWorkload() { VoltTable[] results = null; String procName; int procCount = 0; int sysprocCount = 0; try { results = client.callProcedure("@Statistics", "INITIATOR",1).getResults(); } catch (Exception e) { e.printStackTrace(); } for (VoltTable t: results) { for (int r=0;r<t.getRowCount();r++) { VoltTableRow row = t.fetchRow(r); procName = row.getString("PROCEDURE_NAME"); /* Count system procedures separately */ if (procName.substring(0,1).compareTo("@") == 0) { sysprocCount += row.getLong("INVOCATIONS"); } else { procCount += row.getLong("INVOCATIONS"); } } } System.out.printf("System procedures: %d\n" + "User-defined procedures: %d\n",+ sysprocCount,procCount); }