Called after check is run.
@param result result from check.
@param startTimeNanos start time of check.
973033
public void afterCheck(Result result, long startTimeNanos) {
    switch (result) {
      case FAILED:
        Instrumented.markMeter(this.failedRecordsMeter);
        break;
      case PASSED:
        Instrumented.markMeter(this.passedRecordsMeter);
        break;
      default:
    }

    Instrumented.updateTimer(this.policyTimer, System.nanoTime() - startTimeNanos, TimeUnit.NANOSECONDS);
  }
655587
@Override
  public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
                       throws Exception {
    long currentTime = System.currentTimeMillis();
    String measurementPrefix = getPrefix(handler);

    Object startTimeAttribute = getAndRemoveAttribute(request, START_TIME);
    Object postHandleObject = getAndRemoveAttribute(request, POST_HANDLE_TIME);

    if (startTimeAttribute == null) {
      LOG.info("Could not find start_time. Something went wrong with handler: " + measurementPrefix);
      monitor.incrementCounter(measurementPrefix + TIME_ERROR);
      return;
    }

    long startTime = (Long) startTimeAttribute;
    if (ex != null) {
      monitor.addTimerMeasurement(measurementPrefix + ERROR, startTime, currentTime);
    } else {
      if (postHandleObject != null) {
        long postHandleTime = (Long) postHandleObject;

        monitor.addTimerMeasurement(measurementPrefix + RENDERING, postHandleTime, currentTime);
        monitor.addTimerMeasurement(measurementPrefix + COMPLETE, startTime, currentTime);
      }
    }
  }
808718
public void record(CircuitBreakerStateImpl.CircuitBreakerResult result) {
        boolean isFailure = (result == FAILURE);
        if (resultCount < size) {
            // Window is not yet full
            resultCount++;
        } else {
            // Window is full, roll off the oldest result
            boolean oldestResultIsFailure = results.get(nextResultIndex);
            if (oldestResultIsFailure) {
                failures--;
            }
        }

        results.set(nextResultIndex, isFailure);
        if (isFailure) {
            failures++;
        }

        nextResultIndex++;
        if (nextResultIndex >= size) {
            nextResultIndex = 0;
        }
    }
421862
public void setResult(R result) {
        try {
            lock.lock();
            this.result = result;
            notifyHaveResult();
        }
        finally {
            lock.unlock();
        }
    }
47832
public void waitToFinish(PipelineResult result) {
    pipelinesToCancel.add(result);
    if (!options.as(ExampleOptions.class).getKeepJobsRunning()) {
      addShutdownHook(pipelinesToCancel);
    }
    try {
      result.waitUntilFinish();
    } catch (UnsupportedOperationException e) {
      // Do nothing if the given PipelineResult doesn't support waitUntilFinish(),
      // such as EvaluationResults returned by DirectRunner.
      tearDown();
      printPendingMessages();
    } catch (Exception e) {
      throw new RuntimeException("Failed to wait the pipeline until finish: " + result);
    }
  }
706017
protected ExecutionResult postExecute(ExecutionResult result) {
    if (isFailure(result)) {
      result = onFailure(result.with(false, false));
      callFailureListener(result);
    } else {
      result = result.with(true, true);
      onSuccess(result);
      callSuccessListener(result);
    }

    return result;
  }
134421
@Override
    public IPromise<T> onResult(Consumer<T> resultHandler) {
        if (realCallback instanceof IPromise == false)
            throw new RuntimeException("this is an error.");
        else
            return ((IPromise)realCallback).onResult(resultHandler);
    }
900343
public function setResults($results = null, bool $stopPropagation = false) {
        $this->result = $results;
        if ($stopPropagation) {
            $this->stopPropagation();
        }
    }
92314
public void setResult(Result result) throws IllegalArgumentException
  {
    if(null == result)
      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null");        
    m_result = result;
  }
537894
@Override
  public void processNewResult(ResultHierarchy hier, Result result) {
    // Get all new clusterings
    // TODO: handle clusterings added later, too. Can we update the result?

    List<Clustering<?>> clusterings = Clustering.getClusteringResults(result);
    // Abort if not enough clusterings to compare
    if(clusterings.size() < 2) {
      return;
    }

    // create segments
    Segments segments = new Segments(clusterings);
    hier.add(result, segments);
  }
1229914
public synchronized void onRequestSucceeded(long startTimeInNanos) {
		long micros = (System.nanoTime() - startTimeInNanos) / 1000;
		allRequestsTracker.onRequestSucceeded(micros);
		recentRequestsTracker.onRequestSucceeded(micros);
		meter.mark();
	}
626848
@Override
    public IPromise<T> then(Runnable result) {
        if (realCallback instanceof IPromise == false)
            throw new RuntimeException("this is an error.");
        else
            return ((IPromise)realCallback).then(result);
    }
1258670
public void processResponse(Object result) {
        if (result instanceof JSObject) {
            MaxZoomResult mzr = new MaxZoomResult((JSObject) result);
            callback.maxZoomReceived(mzr);
        }
    }
677918
protected void transmitPartialTask(final Task<Diff> result)
		throws TimeoutException
	{

		this.diffedSize += result.byteSize();
		this.processingTimeDiff += System.currentTimeMillis() - startTime;

		super.transmitPartialTask(result);

		startTime = System.currentTimeMillis();
	}
1355994
public void setResult(Object result) {
        if (resultSent) {
            throw new RuntimeException("You can only set the result once.");
        }
        this.resultSent = true;
        Channel channel = this.channel.get();
        if (channel == null) {
            log.warn("The client is no longer connected.");
            return;
        }
        call.setResult(result);
        Invoke reply = new Invoke();
        reply.setCall(call);
        reply.setTransactionId(transactionId);
        channel.write(reply);
        channel.getConnection().unregisterDeferredResult(this);
    }
729908
protected void verifyTimestamp(WSHandlerResult result) throws WSSecurityException {
        List<WSSecurityEngineResult> insertTimestampResults = result.getActionResults().getOrDefault(WSConstants.TS, emptyList());
        if (insertTimestampResults.isEmpty()) {
            throw new Wss4jSecurityValidationException("No action results for 'Insert timestamp' found");
        } else if (insertTimestampResults.size() > 1) {
            throw new Wss4jSecurityValidationException("Multiple action results for 'Insert timestamp' found. Expected only 1.");
        }
        WSSecurityEngineResult actionResult = insertTimestampResults.get(0);

        if (actionResult != null) {
            Timestamp timestamp = (Timestamp) actionResult.get(WSSecurityEngineResult.TAG_TIMESTAMP);
            if (timestamp != null && timestampStrict) {
                Credential credential = new Credential();
                credential.setTimestamp(timestamp);

                RequestData requestData = new RequestData();
                requestData.setWssConfig(WSSConfig.getNewInstance());
                requestData.setTimeStampTTL(validationTimeToLive);
                requestData.setTimeStampStrict(timestampStrict);

                TimestampValidator validator = new TimestampValidator();
                validator.validate(credential, requestData);
            }
        }
    }
656023
protected void reportStorageOpTime(long startNs) {
        if(streamStats != null) {
            streamStats.reportStreamingScan(operation);
            streamStats.reportStorageTime(operation,
                                          Utils.elapsedTimeNs(startNs, System.nanoTime()));
        }
    }