Refreshes the performance measures of a bounce proxy instance, e.g.
active long polls.

@param bpId
the identifier of the bounce proxy
@param performanceMap
key-value pairs of performance measures
@return empty response
968205
@POST
    @Path("/{bpid: ([A-Z,a-z,0-9,_,\\-]+)(\\.)([A-Z,a-z,0-9,_,\\-]+)}/performance")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.TEXT_PLAIN })
    public Response reportPerformance(@PathParam("bpid") String bpId, Map<String, Integer> performanceMap) {

        if (!monitoringService.isRegistered(bpId)) {
            throw new JoynrHttpException(Status.BAD_REQUEST,
                                         JoynrBounceProxyControlErrorCode.BOUNCEPROXY_UNKNOWN,
                                         "bounce proxy '" + bpId + "'");
        }

        PerformanceMeasures performanceMeasures = new PerformanceMeasures();
        performanceMeasures.addMeasures(performanceMap);

        monitoringService.updatePerformanceMeasures(bpId, performanceMeasures);

        return Response.noContent().build();
    }
1342843
protected void finalizeProfileResponse(final AccessToken accessTokenTicket, final Map<String, Object> map, final Principal principal) {
        val service = accessTokenTicket.getService();
        val registeredService = servicesManager.findServiceBy(service);
        if (registeredService instanceof OAuthRegisteredService) {
            val oauth = (OAuthRegisteredService) registeredService;
            map.put(OAuth20Constants.CLIENT_ID, oauth.getClientId());
            map.put(CasProtocolConstants.PARAMETER_SERVICE, service.getId());
        }
    }
856764
protected synchronized void processResultFor(
            String requesterID,
            String conversationID, 
            Collection dataCollection) 
                throws ServiceExecutionException, SemanticModelException
    {
              
        String methodName = getResponseToFrom(
            Thread.currentThread().getStackTrace()[2].getClassName(),
            Thread.currentThread().getStackTrace()[2].getMethodName()
        );
        
        if (null == methodName) 
        {
            BSDFLogger.getLogger().debug("Cannot process result for requester: " + requesterID
                            + " and conversation: " + conversationID);
            return;
        }        
        
        Collection <IResult> results = new ArrayList<IResult>();

        IFunctionalityImplementation functionalityImplementation
                = this.functionalityImplementations.get(methodName);

        if (null != functionalityImplementation)
        {
            for (Object dataObj : dataCollection)
            {
                results.add(functionalityImplementation.createOutput(
                        dataObj,
                        functionalityImplementation.getAdvertisedFunctionality()));
            }
            
            FunctionalityResultMessage resultMsg = new FunctionalityResultMessage(
                    results, 
                    functionalityImplementation.name());

            BSDFLogger.getLogger().debug(
                    "Registers results as a FunctionalityResultMessage for requester: " + requesterID
                    + " and conversation: " + conversationID);
            
            for (IFunctionalityGrounding funcGr : 
                    functionalityImplementation.getAdvertisedFunctionality().getFunctionalityGroundings())
            {
                funcGr.registerResult(requesterID, conversationID, resultMsg);
            }
            return;
        }
        BSDFLogger.getLogger().debug("Cannot process result for requester: " + requesterID
                            + " and conversation: " + conversationID);
    }
431639
def ReadResponsesForRequestId(self, session_id, request_id, timestamp=None):
    
    request = rdf_flow_runner.RequestState(id=request_id, session_id=session_id)
    for _, responses in self.ReadResponses([request], timestamp=timestamp):
      return responses
318235
public synchronized RequestsTracker snapshot(boolean reset) {
		long t = executing.getCount();
		long r = rejected.getCount();
		long f = failed.getCount();
		TimeCounter c = counter.snapshot(reset);
		IntervalHistogram h = histogram.snapshot(reset);

		if (reset) {
			executing.reset();
			rejected.reset();
			failed.reset();
			succeeded.reset();
		}

		return new RequestsTracker(t, r, f, c, h, lastFailureReason,
				lastRejectReason);
	}
764905
Observable<ChatResult> synchroniseConversation(String conversationId) {

        return checkState().flatMap(client -> client.service().messaging()
                .queryMessages(conversationId, null, 1)
                .map(result -> {
                    if (result.isSuccessful() && result.getResult() != null) {
                        return (long) result.getResult().getLatestEventId();
                    }
                    return -1L;
                })
                .flatMap(result -> persistenceController.getConversation(conversationId).map(loaded -> compare(result, loaded)))
                .flatMap(this::updateLocalConversationList)
                .flatMap(result -> lookForMissingEvents(client, result))
                .map(result -> new ChatResult(result.isSuccessful, null)));
    }
333208
public static base_responses update(nitro_service client, dbdbprofile resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			dbdbprofile updateresources[] = new dbdbprofile[resources.length];
			for (int i=0;i<resources.length;i++){
				updateresources[i] = new dbdbprofile();
				updateresources[i].name = resources[i].name;
				updateresources[i].interpretquery = resources[i].interpretquery;
				updateresources[i].stickiness = resources[i].stickiness;
				updateresources[i].kcdaccount = resources[i].kcdaccount;
				updateresources[i].conmultiplex = resources[i].conmultiplex;
			}
			result = update_bulk_request(client, updateresources);
		}
		return result;
	}
798294
def _refresh(self, **kwargs):
        """"""
        requests_params = self._handle_requests_params(kwargs)
        refresh_session = self._meta_data['bigip']._meta_data['icr_session']

        if self._meta_data['uri'].endswith('/stats/'):
            # Slicing off the trailing slash here for Stats enpoints because
            # iWorkflow doesn't consider those `stats` URLs valid if they
            # include the trailing slash.
            #
            # Other than that, functionality does not change
            uri = self._meta_data['uri'][0:-1]
        else:
            uri = self._meta_data['uri']

        response = refresh_session.get(uri, **requests_params)
        self._local_update(response.json())
14055
function initializePerformance(req, _resp, next) {
    req.amorphicTracking = {
        startTime: process.hrtime(),
        serverTasks: [],
        browserTasks: [],
        loggingContext: {},
        addServerTask: function addTask(props, hrStartTime) {
            let diff = process.hrtime(hrStartTime);
            let took = (diff[0] * 1e9 + diff[1]) / 1000000;
            props.time = took;
            this.serverTasks.push(props);
        }
    };

    next();
}
438958
public void resetRetryCount(String clientId)
	{
		Integer currentRetryCount = this.retryCounts.get(clientId);
		if (currentRetryCount != null && currentRetryCount.intValue() != 0)
		{
			this.retryCounts.put(clientId, 0);
		}
	}
1017958
public static void validatePromotionSuccessful(HttpResponse response, boolean dryRun, boolean failFast, TaskListener listener) throws IOException {
        StatusLine status = response.getStatusLine();
        String content;

        try {
            content = ExtractorUtils.entityToString(response.getEntity());
        } catch (IOException e) {
            throw new IOException("Failed parsing promotion response.", e);
        }

        if (failOnResponseStatus(dryRun, failFast, listener, status, content)) {
            throw new IOException("Promotion failed due to Artifactory response.");
        }

        listener.getLogger().println(content);
    }
991673
@SuppressWarnings("deprecation")
  private void maybeApplyChanges(Map<String, String> queryMap) {
    String changeStr = queryMap.get(CHANGE);
    if (PERMANENT_CHANGE.equals(changeStr)) {
      TraceParams.Builder traceParamsBuilder = traceConfig.getActiveTraceParams().toBuilder();
      String samplingProbabilityStr = queryMap.get(QUERY_COMPONENT_SAMPLING_PROBABILITY);
      if (!isNullOrEmpty(samplingProbabilityStr)) {
        double samplingProbability = Double.parseDouble(samplingProbabilityStr);
        traceParamsBuilder.setSampler(Samplers.probabilitySampler(samplingProbability));
      }
      String maxNumberOfAttributesStr = queryMap.get(QUERY_COMPONENT_MAX_NUMBER_OF_ATTRIBUTES);
      if (!isNullOrEmpty(maxNumberOfAttributesStr)) {
        int maxNumberOfAttributes = Integer.parseInt(maxNumberOfAttributesStr);
        traceParamsBuilder.setMaxNumberOfAttributes(maxNumberOfAttributes);
      }
      String maxNumberOfAnnotationsStr = queryMap.get(QUERY_COMPONENT_MAX_NUMBER_OF_ANNOTATIONS);
      if (!isNullOrEmpty(maxNumberOfAnnotationsStr)) {
        int maxNumberOfAnnotations = Integer.parseInt(maxNumberOfAnnotationsStr);
        traceParamsBuilder.setMaxNumberOfAnnotations(maxNumberOfAnnotations);
      }
      String maxNumberOfNetworkEventsStr =
          queryMap.get(QUERY_COMPONENT_MAX_NUMBER_OF_NETWORK_EVENTS);
      if (!isNullOrEmpty(maxNumberOfNetworkEventsStr)) {
        int maxNumberOfNetworkEvents = Integer.parseInt(maxNumberOfNetworkEventsStr);
        traceParamsBuilder.setMaxNumberOfNetworkEvents(maxNumberOfNetworkEvents);
      }
      String maxNumverOfLinksStr = queryMap.get(QUERY_COMPONENT_MAX_NUMBER_OF_LINKS);
      if (!isNullOrEmpty(maxNumverOfLinksStr)) {
        int maxNumberOfLinks = Integer.parseInt(maxNumverOfLinksStr);
        traceParamsBuilder.setMaxNumberOfLinks(maxNumberOfLinks);
      }
      traceConfig.updateActiveTraceParams(traceParamsBuilder.build());
    } else if (RESTORE_DEFAULT_CHANGE.equals(changeStr)) {
      traceConfig.updateActiveTraceParams(TraceParams.DEFAULT);
    }
  }
127927
private void handleChangeCleaningInterval(final HttpServletRequest req,
      final Map<String, Object> ret) {
    try {
      final long newInterval = getLongParam(req, STATS_MAP_CLEANINGINTERVAL);
      if (MetricReportManager.isAvailable()) {
        final MetricReportManager metricManager = MetricReportManager.getInstance();
        final InMemoryMetricEmitter memoryEmitter =
            extractInMemoryMetricEmitter(metricManager);
        memoryEmitter.setReportingInterval(newInterval);
        ret.put(STATUS_PARAM, RESPONSE_SUCCESS);
      } else {
        ret.put(RESPONSE_ERROR, "MetricManager is not available");
      }
    } catch (final Exception e) {
      logger.error(e);
      ret.put(RESPONSE_ERROR, e.getMessage());
    }
  }
1035697
@Override
   public ManagerStatusResponse handleStatusRequest(int viewId) {
      try {
         // As long as we have an older view, we can still process topologies from the old coordinator
         waitForView(viewId, getGlobalTimeout(), TimeUnit.MILLISECONDS);
      } catch (InterruptedException e) {
         // Shutting down, send back an empty status
         Thread.currentThread().interrupt();
         return new ManagerStatusResponse(Collections.emptyMap(), true);
      }

      Map<String, CacheStatusResponse> caches = new HashMap<>();
      synchronized (runningCaches) {
         latestStatusResponseViewId = viewId;

         for (Map.Entry<String, LocalCacheStatus> e : runningCaches.entrySet()) {
            String cacheName = e.getKey();
            LocalCacheStatus cacheStatus = runningCaches.get(cacheName);
            caches.put(e.getKey(), new CacheStatusResponse(cacheStatus.getJoinInfo(),
                    cacheStatus.getCurrentTopology(), cacheStatus.getStableTopology(),
                    cacheStatus.getPartitionHandlingManager().getAvailabilityMode()));
         }
      }

      boolean rebalancingEnabled = true;
      // Avoid adding a direct dependency to the ClusterTopologyManager
      ReplicableCommand command = new CacheTopologyControlCommand(null,
            CacheTopologyControlCommand.Type.POLICY_GET_STATUS, transport.getAddress(),
            transport.getViewId());
      try {
         gcr.wireDependencies(command);
         SuccessfulResponse response = (SuccessfulResponse) command.invoke();
         rebalancingEnabled = (Boolean) response.getResponseValue();
      } catch (Throwable t) {
         log.warn("Failed to obtain the rebalancing status", t);
      }
      log.debugf("Sending cluster status response for view %d", viewId);
      return new ManagerStatusResponse(caches, rebalancingEnabled);
   }
307585
function displayPerformance(req) {
    let logger = Semotus.createLogger();

    logger.setContextProps(req.amorphicTracking.loggingContext);

    let diff = process.hrtime(req.amorphicTracking.startTime);
    let totalTime = (diff[0] * 1e9 + diff[1]) / 1000000;
    let taskTime = 0;

    req.amorphicTracking.serverTasks.forEach(function d(task) {
        taskTime += task.time;
    });

    logger.info({
        component: 'amorphic',
        module: 'listen',
        duration: totalTime,
        browserPerformance: req.amorphicTracking.browser,
        serverTasks: req.amorphicTracking.serverTasks,
        unaccounted: totalTime - taskTime},
        'Request Performance');
}
1050096
private void mkRefreshConfThread(final NimbusData nimbusData) {
        nimbusData.getScheduExec().scheduleAtFixedRate(new RunnableCallback() {
            @Override
            public void run() {
                LOG.debug("checking changes in storm.yaml...");

                Map newConf = Utils.readStormConfig();
                if (Utils.isConfigChanged(nimbusData.getConf(), newConf)) {
                    LOG.warn("detected changes in storm.yaml, updating...");
                    synchronized (nimbusData.getConf()) {
                        nimbusData.getConf().clear();
                        nimbusData.getConf().putAll(newConf);
                    }

                    RefreshableComponents.refresh(newConf);
                } else {
                    LOG.debug("no changes detected, stay put.");
                }
            }

            @Override
            public Object getResult() {
                return 15;
            }
        }, 15, 15, TimeUnit.SECONDS);

        LOG.info("Successfully init configuration refresh thread");
    }
529858
public void checkServerState(final AsyncCallback<Boolean> callback, final String standBy, final String success) {

        // :read-attribute(name=process-type)
        final ModelNode operation = new ModelNode();
        operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
        operation.get(NAME).set("server-state");
        operation.get(ADDRESS).setEmptyList();

        dispatchAsync.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {

            @Override
            public void onSuccess(DMRResponse result) {

                ModelNode response = result.get();

                if (response.isFailure()) {
                    callback.onFailure(new RuntimeException("Failed to poll server state"));
                } else {
                    // TODO: only works when this response changes the reload state
                    String outcome = response.get(RESULT).asString();
                    boolean keepRunning = !outcome.equalsIgnoreCase("running");//reloadState.isStaleModel();

                    if (!keepRunning) {

                        // clear state
                        reloadState.reset();

                        Console.info(Console.MESSAGES.successful(success));

                        // clear reload state
                        eventBus.fireEvent(new ReloadEvent());
                    }

                    callback.onSuccess(keepRunning);
                }
            }

            @Override
            public void onFailure(Throwable caught) {
                Console.getMessageCenter().notify(new Message(standBy, caught.getMessage(), Message.Severity.Warning));
            }
        });
    }