Returns the total number of attempts of the current request represented by the specified
{@link ClientRequestContext}.
340802
protected static int getTotalAttempts(ClientRequestContext ctx) {
        final State state = ctx.attr(STATE).get();
        if (state == null) {
            return 0;
        }
        return state.totalAttemptNo;
    }
342200
public function searchContentfulEntriesCount(string $searchText, ?Client $client = null): int
    {
        $client = $client ?? $this->defaultClient;

        $query = new Query();
        $query->where('query', $searchText);

        return count($client->getEntries($query));
    }
685295
public static String getContextRequestUri(HttpServletRequest request) {
		String requestUri = request.getRequestURI();
		String contextPath = request.getContextPath();
		int cpLen = contextPath.length();
		if(cpLen > 0) {
			assert requestUri.startsWith(contextPath);
			return requestUri.substring(cpLen);
		} else {
			return requestUri;
		}
	}
396495
public long getNumberOfCurrentRequests()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfCurrentRequests");
    //request, value, rejected and accepted messages are all counted
    long returnValue = _aoStream.getNumberOfRequestsInState(TickRange.Requested);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Value);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Rejected);
    returnValue+=_aoStream.getNumberOfRequestsInState(TickRange.Accepted);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getNumberOfCurrentRequests", new Long(returnValue));
    return returnValue;     
  }
1346063
public int getRemainingMessageCount()
  throws SISessionUnavailableException, SISessionDroppedException,
         SIIncorrectCallException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.entry(CoreSPILockedMessageEnumeration.tc, "getRemainingMessageCount",
        new Object[] {new Integer(hashCode()), this});

    int count = 0;

    checkValidState("getRemainingMessageCount");

    localConsumerPoint.checkNotClosed();

    synchronized(this)
    {
      // If we've reached the end the count is zero
      if(!endReached)
      {
        LMEMessage message;

        // If currentMsg is null it means we start from the begining
        if(currentMsg == null)
          message = firstMsg;
        else
          message = currentMsg.next;

        while(message != null)
        {
          count++;
          message = message.next;
        }
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.exit(CoreSPILockedMessageEnumeration.tc, "getRemainingMessageCount", new Integer(count));

    return count;
  }
78388
public static HttpServletRequest getHttpServletRequestFromExternalWebflowContext(final RequestContext context) {
        Assert.isInstanceOf(ServletExternalContext.class, context.getExternalContext(),
            "Cannot obtain HttpServletRequest from event of type: "
                + context.getExternalContext().getClass().getName());

        return (HttpServletRequest) context.getExternalContext().getNativeRequest();
    }
1086068
final public int getConnectionCount() {
		int total = 0;
		synchronized(poolLock) {
			for(PooledConnection<C> pooledConnection : allConnections) {
				if(pooledConnection.connection!=null) total++;
			}
		}
		return total;
	}
748610
public final int getActiveConnectionCount() {

      if(!isActive) {
         return 0;
      }

      int count = 0;
      for(ConnectionPoolConnection conn : connections) {
         if(conn.state.get() != ConnectionPoolConnection.STATE_AVAILABLE) {
            count++;
         }
      }

      return count;
   }
762966
public function count()
    {
        $request = $this->createRequestInstance(self::CAT_COUNT, null, null);

        return $this->client->send($request);
    }
308654
public DrpcRequestInfo fetch() throws TException
    {
        DrpcRequestInfo result = null;

        for (int index = 0; index < this.clients.size(); index++)
        {
            DRPCInvocationsClient client = this.clients.get(index);
            DRPCRequest request = client.fetchRequest(this.function);
            String requestId = request.get_request_id();
            if (requestId.length() > 0)
            {
                result = new DrpcRequestInfo();
                result.setRequestId(requestId);
                result.setFuncArgs(request.get_func_args());
                this.requestedMap.put(requestId, index);
                break;
            }
        }

        return result;
    }
1122679
def count(self, eventRegistry):
        
        self.setRequestedResult(RequestEventArticles(**self.queryParams))
        res = eventRegistry.execQuery(self)
        if "error" in res:
            print(res["error"])
        count = res.get(self.queryParams["eventUri"], {}).get("articles", {}).get("totalResults", 0)
        return count
1068795
public int getAttempts() {
        String attempts = this.properties.get("attempts");
        if (attempts == null) {
            attempts = "0";
        }

        return Integer.parseInt(attempts);
    }
100417
def getResultsTotalCount(self):
        
        count = 0
        for val in self.getRawResults().values():
            count += len(val)
        return count
770536
public static String getHttpServletRequestUserAgentFromRequestContext(final RequestContext context) {
        val request = getHttpServletRequestFromExternalWebflowContext(context);
        return getHttpServletRequestUserAgentFromRequestContext(request);
    }
242823
protected int getCount(int type, Collection<ConnectionListener> listeners)
   {
      int count = 0;

      for (ConnectionListener cl : listeners)
      {
         if (cl.getState() == type)
            count++;
      }

      return count;
   }
1263839
function () {
    count = count + 1;
    if (count > maxAttempts) {
      return callback('Max Attempts hit', { created: false });
    }
    request(options, function (err, response) {
      if (err) {
        return callback(err, { created: false });
      }
      if (response.statusCode === 200) {
        return callback(null, { created: true });
      }
      setTimeout(t, interval);
    });
  }
1175257
public synchronized void incrementUseCount()
          throws SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "incrementUseCount");

      // Check if this ordering conext instance is "dead". If it is, then this order context has been closed and
      // we need to obtain a new proxy id for it.
      if (dead) {
        setOrderingContextProxyId();
        dead = false;
      }

      useCount++;
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Use count is now: " + useCount);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "incrementUseCount");
   }