PDCE Functions Overview

The PDCE (Performance Data Collection Engine) is an internal engine of Performance Explorer used for online monitoring. Its interface can also be used in the BDL of Silk Performer for monitoring PDCE data sources.

Therefore all measures that Performance Explorer is able to monitor in real-time can also be used the same way with the BDL of Performance Explorer. After the execution of some registering functions you are able to get the data out of the PDCE through the provided polling functions. These functions provide data, status information, and a description for the measures (if available).

Terminology

Client

Any source that is registered in the Performance Data Collection Engine for collecting measure data (Silk Performance Manager, Silk Performer, Performance Explorer, TSD Writer).

Measure A measure is the data object that stores the collected data of the queries with corresponding statistic data (sum, min, max, avg, stdev,...). It provides access to this data, and additional information about the measure itself (measure type, description, status,...).
Measure Group Measure groups are a collection of all measures that are of the same measure type and have the same update interval. Such a group has all the logic to perform the necessary queries for measure updates and to provide this data to the clients.
Interval Manager The Interval Manager adds new subscribed measures to the correct measure group. Additionally, it contains a scheduler that initiates the queries for measure updates for every Measure Group.
Performance Data Collection Engine A library, that allows multiple clients to register different types of measures (NT System Data, SNMP Data, Silk Performer data,...) for data collection. This data is either provided to the clients for real time monitoring or for writing to a Timeseries Data file (TSD Writer).

Example

//-------------------------------------------------------
// Performance monitoring script uses polling functions of PDCE interface
// for monitoring all supported performance data source of the PDCE.
//-------------------------------------------------------
//-------------------------------------------------------
benchmark SilkPerformer Pdce
use "pdce.bdh" 

const  
    STRING_SIZE := 1024;  
    NUMBER_OF_MEASURES := 7;  

    // sample measure strings for different data sources  
    RSTAT_SAMPLE_MEASURE := "RStat:Total Cpu@localhost";  
    SNMP_SAMPLE_MEASURE := "SNMP:1.3.6.1.4.1.3068.1.7.3.16.0@localhost";  
    PERFMON_SAMPLE_MEASURE := "PERFMON:\\Processor(_Total)\\% Processor Time@localhost";  
    REXEC_SAMPLE_MEASURE := "REXEC:VMSTAT:0\\9@localhost";  
    WEBSPHERE_SAMPLE_MEASURE := "WS35:localhost.Default Server.runtime.resources.memFree@localhost:900";  
    PMI_SAMPLE_MEASURE := "PMI:localhost\\Default Server\\jvmRuntimeModule\\1@localhost:900";  
    PERFSERVLET_MEASURE := "PERFSERVLET:vangelis\Default Server\jvmRuntimeModule\totalMemory\@vangelis:80?/wasPerfTool/servlet/perfservlet" 

// Definition of global variables: string, number, float, boolean, array
var  
    pClient      :number;  
    pMeasure     :array[NUMBER_OF_MEASURES] of number;  
    sMeasureName :array[NUMBER_OF_MEASURES] of string;   

    fMeasureLastValue :float;   
    fMeasureSum   :float;  
    fMeasureMin   :float;  
    fMeasureMax   :float;  
    fMeasureAvg   :float;  
    fMeasureStDev :float;   

    uiMeasureTimeStamp :number;  
    uiMeasureStatus    :number;   

    sDescription :string(STRING_SIZE);  
    sErrorText   :string(STRING_SIZE);  
    sMeasureKey  :string;  
    uiErrorCode  :number;   

    uiPdceInternalQueryInterval : number init 5000;  //msec  
    fPdceInitInterval           : float init 5.0;  //sec  
    fMonitoringInterval         : float init 3.0;  //sec   
    uiTimeStamp                 : number;  
    uiNewPdceInternalQueryInterval : number init 10000; //msec 

// Workload Section
dcluser
    user    
      VPdceMonitor
    transactions    
      TInit        : begin; // Initialization    
      TPdceMonitor : 10; // Transactions    
      TEnd         : end; // Termination  

// Transactions Section -------------------
dcltrans
    transaction TInit
    begin    
      // Insert here the initial statements    
      PdceStartup();    
      PdceClientRegister(pClient, uiPdceInternalQueryInterval);     

      sMeasureKey := PERFMON_SAMPLE_MEASURE;    
      sMeasureName[1] := "PerfmonMeasure1";
          PdceAddMeasure(pClient, sMeasureName[1], sMeasureKey, pMeasure[1]); 

// samples for other datasources, different handle "pMeasure" needed for every measure
/*
      sMeasureKey     := RSTAT_SAMPLE_MEASURE;
      sMeasureName[2] := "RstatMeasure1";
      PdceAddMeasure(pClient,sMeasureName[2],sMeasureKey,pMeasure[2]);     

      sMeasureKey    := SNMP_SAMPLE_MEASURE;
      sMeasureName[3] := "SnmpMeasure1";
      PdceAddMeasure(pClient,sMeasureName[3],sMeasureKey,pMeasure[3]);     

      sMeasureKey     := REXEC_SAMPLE_MEASURE;
      sMeasureName[4] := "RexecMeasure1";
      PdceAddMeasure(pClient,sMeasureName[4],sMeasureKey,pMeasure[4]);
      sMeasureKey    := WEBSPHERE_SAMPLE_MEASURE;
      sMeasureName[5] := "WebSphereMeasure1";
      PdceAddMeasure(pClient, sMeasureName[5], sMeasureKey, pMeasure[5]);

      sMeasureKey     := PMI_SAMPLE_MEASURE;    
      sMeasureName[6] := "PmiMeasure1";
      PdceAddMeasure(pClient, sMeasureName[6], sMeasureKey, pMeasure[6]);     

      sMeasureKey     := PERFSERVLET_SAMPLE;    sMeasureName[7] := "PerfServletMeasure1";
      PdceAddMeasure(pClient, sMeasureName[7], sMeasureKey, pMeasure[7]);
*/

      wait(fPdceInitInterval);  
  
      // get time stamp    
      PdceGetStartTickCount(uiTimeStamp);    
      write("Timestamp:");    
      write(uiTimeStamp, 10);        

      // change interval    
      PdceClientInterval(pClient, uiNewPdceInternalQueryInterval);     

      // get description of measures and write to output file
      // ... do for every measure of which you want a detailed description
      PdceMeasureQueryInfo(pMeasure[1], sDescription, STRING_SIZE);
      write(sMeasureName[1]);    write(":  ");
      writeln(sDescription);    
      writeln;  
    end TInit; 

//------------------------------------------ 
    transaction TPdceMonitor
    begin
      // get actual status of measure
      PdceMeasureQueryStatus(pMeasure[1], uiErrorCode, sErrorText, STRING_SIZE);   

      // get actual values of measure
      PdceMeasureQueryValue(pMeasure[1], fMeasureLastValue, fMeasureSum, fMeasureMin, fMeasureMax,      fMeasureAvg, fMeasureStDev, uiMeasureTimeStamp, uiMeasureStatus);     

      // write to output file
      write(sMeasureName[1]);
      write(": Timestamp:");
      write(uiMeasureTimeStamp, 10); 
      write(" Value: ");
      write(fMeasureLastValue, 8, 2);
      write(" Sum: ");
      write(fMeasureSum, 10, 2);
      write(" Min: ");
      write(fMeasureMin, 8, 2);
      write(" Max: ");
      write(fMeasureMax, 8, 2);
      write(" Avg: ");
      write(fMeasureAvg, 8, 2);
      write(" StDev: ");
      write(fMeasureStDev, 8, 2);
      write(" Status: ");
      writeln(sErrorText);
 
      wait(fMonitoringInterval);
    end TPdceMonitor;
 
//------------------------------------------ 

transaction TEnd
    begin
      // every measure has to be unsubscribed; 
      PdceMeasureUnSubscribe(pMeasure[1]);    
      PdceClientUnRegister(pClient);    
      PdceCleanup();  
    end TEnd;