getStatistics

getStatistics(jdo: JadeDynamicObject input);

The getStatistics method of the JadeDbFilePartition class returns statistics relating to read and write operations on the persistent database partition represented by the JadeDbFilePartition instance used as the method receiver.

The values are returned as Integer64 properties in the dynamic object specified by the jdo parameter.

The calling process is responsible for creating and deleting the JadeDynamicObject instance.

The properties returned in the JadeDynamicObject are listed in the following table.

Property Description
logicalReads The total number of read requests
logicalWrites The total number of write requests
logicalReadBytes The total accumulated size for all read requests
logicalWriteBytes The total accumulated size for all write requests
physicalReads The actual number of file partition read operations
physicalWrites The actual number of file partition write operations
physicalReadBytes The actual accumulated size for all file partition read operations
physicalWriteBytes The actual accumulated size for all file partition write operations

The logical counts record the number and size of requests that can be serviced in cache, whereas the physical counts record actual disk activity.

The returned values include cumulative counters, which are not reset during the lifetime of the database server node. You need to compare values from one execution of the getStatistics method with the previous values, to work out the differences.

The cumulative values are held as 64-bit unsigned integers, which are copied to the dynamic object as Integer64 values. The maximum value before they wrap around to negative values is therefore 2^63 - 1 (approximately 8 Exabytes).

The calling process is responsible for creating and deleting the JadeDynamicObject instance. Properties are added to the object when the method is first called. The object can then be used in subsequent calls.

If the dynamic object already contains properties that do not match the properties to be returned, the existing dynamic object properties are removed and replaced with appropriate properties. The method is most efficient when the properties match those to be returned.

The following example shows the use of the getStatistics method.

showAllPartitionStats();
//display file partition statistics for all user files vars
   dbfile : DbFile;
   dbfiles : DbFileArray;
   dbpart : JadeDbFilePartition;
   dbpartitions : JadeDbFilePartitionArray;
   dba : JadeDatabaseAdmin;
   jdo : JadeDynamicObject;
begin
   create dba transient;
   create dbfiles transient;
   dba.getDbFiles(DbFile.Kind_User_Data, dbfiles);
   create dbpartitions transient;
   create jdo transient;
   foreach dbfile in dbfiles do
      if dbfile.isPartitioned then
         dbpartitions.clear;
         dbfile.getPartitions(dbpartitions,0);
         foreach dbpart in dbpartitions do
            dbpart.getStatistics(jdo);
            write dbfile.name & ":" & dbpart.getName & ":" & jdo.display;
         endforeach;
      endif;
   endforeach;
epilog
   delete dbfiles;
   delete dbpartitions;
   delete dba;
   delete jdo;
end;

The output from the getStatistics method shown in the previous example is as follows.

order:part0000000001:---DatabaseFileStatistics(108)---
logicalReads = 0
logicalWrites = 0
logicalReadBytes = 0
logicalWriteBytes = 0
gettotalfilelength64jadedbfilepartitition