:Pausing from forms for keystroke testing

From: Jennifer R. Amon <bamon_at_ocvaxc.cc.oberlin.edu>
Date: Thu, 27 Jan 1994 10:27:01 -0500
Message-ID: <bamon-270194102701_at_amon.cc.oberlin.edu>


I'm running a load test with 40 forms users simulated by keystroke files. In order to get some sort of realistic test, I created a user exit that will pause for a random number of seconds between specified low and high values.

I put it in a key trigger that looks like this:

   DEFINE TRIGGER

      NAME = KEY-DUPREC
      TRIGGER_TYPE = V3
      DESCRIPTION = Pause (for testing)
      TEXT = <<<
      message('Pausing...');
      synchronize;
      user_exit('ORSX0019 20 60'); /* pauses for 20-60 seconds */

>>>

   ENDDEFINE TRIGGER The userexit (in C) looks like this:

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

EXEC SQL INCLUDE ORA_PROC:SQLCA; /***** THIS IS THE MAIN FUNCTION WHICH RETURNS AN INTEGER STATUS CODE *****/

int orsx0019(cmd, cmdlen, msg, msglen, query)

 char *cmd;
 int  *cmdlen;
 char *msg;
 int  *msglen;
 int  *query;

 { /***** BEGIN ORSX0019 *******/    unsigned int seconds;
   int low, high;
   int i, j;

   char callcmd[50] = {'\0'};                   /* user_exit call string */
   char param1[50] = {'\0'};                    /* param1 */
   char param2[50] = {'\0'};                    /* param2 */

/******************************************************
  • Parse the command line (call plus two parameters) ******************************************************/ for (i=0,j=0;cmd[i]!=0 && cmd[i]!=' ';i++,j++) callcmd[j] = cmd[i]; callcmd[j] = 0; i++; for (j = 0;cmd[i]!=0 && cmd[i]!=' ';i++,j++) param1[j] = cmd[i]; param1[j] = 0; i++; for (j = 0;cmd[i]!=0 && cmd[i]!=' ';i++,j++) param2[j] = cmd[i]; param2[j] = 0; i++;

   low = atoi(param1);
   high = atoi(param2);
   seconds = (rand() % (high - low)) + low;    sleep(seconds);
   return(IAPSUCC);

ERROR_RTN:

/***********************************
 * PRINT ORACLE ERROR MESSAGE AND
  • RETURN FAILURE TO SQL*FORMS ***********************************/

   printf("ERROR ----->> %s\n",sqlca.sqlerrm.sqlerrmc);    return(IAPFAIL);
}


Jennifer R. Amon            PHONE: (216) 775-6987
Houck Computing Center        FAX: (216) 775-8573
Oberlin College
Oberlin, OH 44074        INTERNET: bamon_at_ocvaxc.cc.oberlin.edu
_____________________________________________________________________
Received on Thu Jan 27 1994 - 16:27:01 CET

Original text of this message