Exemplo n.º 1
0
        /**
         * Records a sample.
         *
         */
        public void AddSample(ExecuteResult res)
        {
            Int64 aTimeInMillis = res.GetTime();

            counter    += res.getSampleCount();
            errorCount += res.getErrorCount();

            Int64 startTime = res.getStartTime();
            Int64 endTime   = res.getEndTime();

            if (firstTime > startTime)
            {
                // this is our first sample, set the start time to current timestamp
                firstTime = startTime;
            }

            // Always update the end time
            if (lastTime < endTime)
            {
                lastTime = endTime;
            }
            runningSum += aTimeInMillis;

            if (aTimeInMillis > max)
            {
                max = aTimeInMillis;
            }

            if (aTimeInMillis < min)
            {
                min = aTimeInMillis;
            }
        }
Exemplo n.º 2
0
 public void addSubSamplerResult(ExecuteResult res)
 {
     // Another subsample for the transaction
     calls++;
     // The transaction fails if any sub sample fails
     if (!res.Success)
     {
         transactionSampleResult.Success = false;
         noFailingSamples++;
     }
     // Add the sub result to the transaction result
     transactionSampleResult.addSubResult(res);
     // Add current time to total for later use (exclude pause time)
     totalTime += res.GetTime();
 }