Node::getObjectCaches Method

getObjectCaches(dynObj:    JadeDynamicObject input;
                cacheType: Integer);

The Node class getObjectCaches method retrieves information about cache activity for the node specified as the method receiver. You can call this method using any node as the receiver.

The values are returned as properties of a JadeDynamicObject object, relating to the specified node.

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

An example that shows the use of a method to handle the wrapping of negative values when calculating differences is provided later in this subsection. See also the Node class getObjectCaches method, in Volume 2 of the JADE Encyclopaedia of Classes.

The cacheType parameter specifies whether information is retrieved from the persistent, transient, or remote transient cache. The retrieved values are listed in the following table.

Value Description
1 Persistent cache
2 Transient cache
3 Remote transient cache (applicable only on server nodes)

You should use a blank dynamic object the first time you call this method, which adds properties to the object. You can then use this object in subsequent calls.

If the dynamic object passed to the method already contains properties but they do not match the properties to be returned, the existing dynamic object properties are removed and then replaced with the appropriate properties.

The getObjectCaches method is most efficient when the properties match those to be returned.

The properties that are returned to the dynamic object specified in the dynObj parameter are listed in the following table.

All Cache Types Persistent Cache Only Primitive Type Value
clockTicks   Integer64  
nodeCPUTime   Integer64  
nodeTicks   Integer64  
cacheType   Integer64  
hits   Integer64  
misses   Integer64  
topOfLRUHits (no longer maintained)   Integer64 0
createdBuffers   Integer64  
cleanSwappedBuffers   Integer64  
dirtySwappedBuffers   Integer64  
resizedBuffers   Integer64  
maximumBufferSize   Integer64  
totalNumberOfBuffers   Integer64  
availableBufferSize   Integer64  
maximumOverdraftBufferSize   Integer64  
overdraftBufferSize   Integer64  
deadBuffers   Integer64  
  totalOperations Integer64  
  currentOperations Integer64  
  currentBuffers Integer64  
  deletedBuffers Integer64  
  copiedBuffers Integer64  
  newBuffers Integer64  
  fetches Integer64  
  duplicateFetches Integer64  
  totalSwaps Integer64  
  totalOpsWhenSwapped Integer64  
  minOpsWhenSwapped Integer64  
  maxOpsWhenSwapped Integer64  
  totalAgeWhenSwapped Integer64  
  minAgeWhenSwapped Integer64  
  maxAgeWhenSwapped Integer64  
  lruTraversals Integer64  
  totalLruTraversalTicks Integer64  
  latestLruTraversalTicks Integer64  
  totalCacheCoherencyNotifications Integer64  
  cacheCoherencyNotificationHits Integer64  
  cacheCoherencyUpdatedObjects Integer64  
  cacheCoherencyObjectHits Integer64  
  cacheCoherencyObjectMisses Integer64  
  cacheCoherencyRangeRequests Integer64  
  nodeLockRemoveRequestsSent Integer64  
  nodeLockRemoveRequestsRcvd Integer64  
  nodeLockSwapOutRequestsSent Integer64  

For explanations about these direct node statistics, see "Cache Statistics" under "Statistics File Format", later in this chapter.

The following example that shows the use of the getObjectCaches method to return the number of node ticks over a specified period.

getNodeTicks(seconds: Integer): Integer64;
vars
    sample              : JadeDynamicObject;
    cumulativeNodeTicks : Integer64;
    nodeTicks           : Integer64;
begin
    create sample transient;
    node.getObjectCaches(sample, 1);    // persistent cache
    cumulativeNodeTicks := sample.getPropertyValue("nodeTicks").Integer64;
    process.sleep(seconds*1000);
    node.getObjectCaches(sample, 1);
    nodeTicks := sample.getPropertyValue("nodeTicks");
    if nodeTicks >= cumulativeNodeTicks then
        nodeTicks := nodeTicks – cumulativeNodeTicks;
    else // wrapped to a negative value
        nodeTicks := (Max_Integer64 – cumulativeNodeTicks) + 1 +
                 (nodeTicks – Min_Integer64);
    endif;
    delete sample;
    return nodeTicks;
end;