Adds the performance to the cache and the current list of performances.

@param performance	the performance to add
@param folds	the number of folds
540390
public void addPerformance(Performance performance, int folds) {

    m_Performances.add(performance);
    m_Cache.add(folds, performance);
    m_Trace.add(new AbstractMap.SimpleEntry<Integer, Performance>(folds, performance));
  }
535604
public void updateStatus(long result) {
		if(result != - 1) {
			Double time = execTime / 1000;
			String s = String.format("Execution time: %s sec - Number of rows retrieved: %,d ", time, result);
			Runnable time_setter = new ExecTimeSetter(s);
			SwingUtilities.invokeLater(time_setter);
		}
	}
995874
public void cache(Map<String, Object> resources) {
		verifyState();

		if (!cacheLocked.get()) {
			resourceCache.get().putAll(resources);
		}
	}
525173
public void setCacheCapacity(int capacity) {
        if (capacity > 0) {
            cache = new ConcurrentLinkedHashMap<K, V>(capacity);
        } else {
            cache = new ConcurrentHashMap<K, V>();
        }
    }
818828
@Override
	public void cacheResult(List<CPDisplayLayout> cpDisplayLayouts) {
		for (CPDisplayLayout cpDisplayLayout : cpDisplayLayouts) {
			if (entityCache.getResult(
						CPDisplayLayoutModelImpl.ENTITY_CACHE_ENABLED,
						CPDisplayLayoutImpl.class,
						cpDisplayLayout.getPrimaryKey()) == null) {
				cacheResult(cpDisplayLayout);
			}
			else {
				cpDisplayLayout.resetOriginalValues();
			}
		}
	}
922454
function(markName) {
			if (window.performance && window.performance.mark !== undefined) {
				window.performance.mark(markName);
			}
		}
157553
public void addRequest(final CachedSpiceRequest<?> request, final Set<RequestListener<?>> listRequestListener) {
        if (isStopped) {
            Ln.d("Dropping request : " + request + " as processor is stopped.");
            return;
        }

        Ln.d("Adding request to queue " + hashCode() + ": " + request + " size is " + mapRequestToRequestListener.size());

        if (request.isCancelled()) {
            synchronized (mapRequestToRequestListener) {
                for (final CachedSpiceRequest<?> cachedSpiceRequest : mapRequestToRequestListener.keySet()) {
                    if (request.equals(cachedSpiceRequest)) {
                        cachedSpiceRequest.cancel();
                        requestProgressManager.notifyListenersOfRequestCancellation(request);
                        return;
                    }
                }
            }
        }

        boolean aggregated = false;
        Set<RequestListener<?>> listRequestListenerForThisRequest;

        synchronized (mapRequestToRequestListener) {
            listRequestListenerForThisRequest = mapRequestToRequestListener.get(request);

            if (listRequestListenerForThisRequest == null) {
                if (request.isProcessable()) {
                    Ln.d("Adding entry for type %s and cacheKey %s.", request.getResultType(), request.getRequestCacheKey());
                    listRequestListenerForThisRequest = Collections.synchronizedSet(new HashSet<RequestListener<?>>());
                    this.mapRequestToRequestListener.put(request, listRequestListenerForThisRequest);
                }
            } else {
                Ln.d("Request for type %s and cacheKey %s already exists.", request.getResultType(), request.getRequestCacheKey());
                aggregated = true;
            }
        }

        if (listRequestListener != null && listRequestListenerForThisRequest != null) {
            listRequestListenerForThisRequest.addAll(listRequestListener);
        }

        if (aggregated) {
            requestProgressManager.notifyListenersOfRequestAggregated(request, listRequestListener);
            return;
        }

        if (request.isProcessable()) {
            requestProgressManager.notifyListenersOfRequestAdded(request, listRequestListener);
        } else {
            if (listRequestListenerForThisRequest == null) {
                requestProgressManager.notifyListenersOfRequestNotFound(request, listRequestListener);
            }
            requestProgressManager.notifyOfRequestProcessed(request, listRequestListener);
            // we have to return if request is not processable.
            // fix bug https://github.com/octo-online/robospice/issues/215
            return;
        }

        final RequestCancellationListener requestCancellationListener = new RequestCancellationListener() {

            @Override
            public void onRequestCancelled() {
                requestProgressManager.notifyListenersOfRequestCancellation(request);
                mapRequestToRequestListener.remove(request);
            }
        };
        request.setRequestCancellationListener(requestCancellationListener);

        if (request.isCancelled()) {
            requestProgressManager.notifyListenersOfRequestCancellation(request);
            mapRequestToRequestListener.remove(request);
            return;
        } else {
            requestRunner.executeRequest(request);
        }
    }
1111430
@Override
    public FutureAppendable performAppends(int timeout, TimeUnit unit) throws IOException, HttpErrorPage,
            TimeoutException {
        return this.futureBuilder.performAppends(timeout, unit);
    }
700886
public void cacheIncludeAndIgnore(WebElement table) {
        if (getIgnoreByMatches() == null) {
            setIgnoreByMatches(new ArrayList<WebElement>());
            for (By by : getIgnoreRowsMatching()) {
                getIgnoreByMatches().addAll(table.findElements(by));
            }
        }
        if (getIncludeByMatches() == null) {
            setIncludeByMatches(new ArrayList<WebElement>());
            for (By by : getIncludeOnlyRowsMatching()) {
                getIncludeByMatches().addAll(table.findElements(by));
            }
        }
    }
1089334
public void setEvaluationResults(java.util.Collection<EvaluationResult> evaluationResults) {
        if (evaluationResults == null) {
            this.evaluationResults = null;
            return;
        }

        this.evaluationResults = new com.amazonaws.internal.SdkInternalList<EvaluationResult>(evaluationResults);
    }
1314759
def save_performance(self, ncores, nfilters, ntemplates, run_time,
                         setup_time):
        
        self.run_time = run_time
        self.setup_time = setup_time
        self.ncores = ncores
        self.nfilters = nfilters
        self.ntemplates = ntemplates
        self.write_performance = True
586742
private static void addNonHeapMetrics(Collection<Metric<?>> result) {
        MemoryUsage memoryUsage = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
        result.add(newMemoryMetric("nonheap.committed", memoryUsage.getCommitted()));
        result.add(newMemoryMetric("nonheap.init", memoryUsage.getInit()));
        result.add(newMemoryMetric("nonheap.used", memoryUsage.getUsed()));
        result.add(newMemoryMetric("nonheap", memoryUsage.getMax()));
    }
1148631
private void addResult(ValidationResult result) {
		if (result == null || result.count() == 0) {
			return;
		}
		this.results.add(result);
	}
1285284
private void writeCachedResultToStream(HttpServletResponse res) throws IOException {

        List<Object> elements = m_cachedEntry.elements();
        int count = 0;
        if (elements != null) {
            for (int i = 0; i < elements.size(); i++) {
                Object o = elements.get(i);
                if (o instanceof byte[]) {
                    res.getOutputStream().write((byte[])o);
                } else {
                    if ((m_includeResults != null) && (m_includeResults.size() > count)) {
                        // make sure that we don't run behind end of list (should never happen, though)
                        res.getOutputStream().write(m_includeResults.get(count));
                        count++;
                    }
                    // skip next entry, which is the parameter map for this include call
                    i++;
                    // skip next entry, which is the attribute map for this include call
                    i++;
                }
            }
        }
706928
@Override
    public String evaluate(String[] requests) throws PEPException {
        logger.debug("evaluating array of String requests");

        long a, b;

        Set<Result> finalResults = new HashSet<Result>();
        for (int i = 0; i < requests.length; i++) {
            String r = requests[i];
            if (r == null) continue;
            ResponseCtx resCtx = null;

            a = System.currentTimeMillis();

            if (responseCache != null) {
                resCtx = responseCache.getCacheItem(r);
            }

            if (resCtx == null) {
                logger.debug("No item found in cache. Sending to PDP for evaluation.");

                org.fcrepo.server.security.RequestCtx req = null;
                try {
                    req = m_contextUtil.makeRequestCtx(r);
                } catch (MelcoeXacmlException e) {
                    throw new PEPException(e);
                }
                resCtx = client.evaluate(req);

                // Add this new result to the cache if caching is enabled
                logger.debug("Adding PDP evaluation results to cache");
                if (responseCache != null) {
                    responseCache.addCacheItem(r, resCtx);
                }
            } else {
                logger.debug("Item found in cache");
            }

            b = System.currentTimeMillis();
            logger.debug("Time taken for XACML Evaluation: {}ms", (b - a));

            @SuppressWarnings("unchecked")
            Set<Result> results = resCtx.getResults();

            finalResults.addAll(results);
        }

        ResponseCtx resultCtx = new ResponseCtx(finalResults);

        return m_contextUtil.makeResponseCtx(resultCtx);
    }
293403
@Override
    protected List<BenchmarkElement> arrangeList(final List<BenchmarkElement> elements) {
        final List<BenchmarkElement> elementList = new LinkedList<BenchmarkElement>();
        elementList.addAll(elements);
        return elementList;
    }
790545
protected void addRes(JTAResource resource) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "addRes", new Object[] { this, resource });

        // Add the reference to the list (which was created when this object was
        // created), with the "registered" status.
        resource.setResourceStatus(StatefulResource.REGISTERED);
        _resourceObjects.add(resource);

        if (tc.isEventEnabled())
            Tr.event(tc, "(SPI) SERVER registered with Transaction. TX: " + _transaction.getLocalTID() + ", Resource: " + resource);
        if (tc.isEntryEnabled())
            Tr.exit(tc, "addRes");
    }