getStatistics

getStatistics(statistics: JadeDynamicObject input) abstract;

The getStatistics method of the Collection class analyzes the collection and returns structural statistics in the attributes of a JadeDynamicObject, representing collection statistics.

The attributes of a collection statistics dynamic object are defined and interpreted as follows.

Attribute Description
avgEntries Average number of entries in collection blocks
blockCount Total number of blocks in the collection
blockSize Entries per block
entrySize Size of each collection entry in bytes
height Number of levels in the collection (always 1 for Array classes)
keyLength Size of the key in bytes (oid (6) for Set classes and Integer (4) for Array classes)
loadFactor Actual average percent loading of collection blocks (entries for each block)
maxEntries Maximum number of entries found in any block
minEntries Minimum number of entries found in any block
size Number of entries in the collection (that is, the size of the collection itself)
totalByteSize Total byte size of all blocks in the collection

To compute the block size in bytes, multiply the blockSize attribute by the entrySize attribute. The maximum collection block size for a collection is 256K bytes (that is, the value defined by the MaximumCollectionBlockSize global constant in the SystemLimits category).

The JadeDynamicObjectNames category global constants for collection statistics are listed in the following table, where the name of the dynamic object represents the collection type of the receiver.

Global Constant String Value
JStats_ArrayName "JStatsArray"
JStats_DictionaryName "JStatsDictionary"
JStats_JadeBytesName "JStatsJadeBytes"
JStats_SetName "JStatsName"

The JadeDynamicObjectTypes category global constants for collection statistics are listed in the following table, where the type of the dynamic object represents the collection type of the receiver.

Global Constant Integer Value
JStats_ArrayType 101
JStats_DictionaryType 102
JStats_JadeBytesType 104
JStats_SetType 103

For details about the behavior and tuning of collections, see Chapter 4 of the Developer's Reference.