Tabnine Logo
StatusInfo$Builder.add
Code IndexAdd Tabnine to your IDE (free)

How to use
add
method
in
com.netflix.eureka.util.StatusInfo$Builder

Best Java code snippets using com.netflix.eureka.util.StatusInfo$Builder.add (Showing top 2 results out of 315)

origin: Netflix/eureka

public StatusInfo getStatusInfo() {
  StatusInfo.Builder builder = StatusInfo.Builder.newBuilder();
  // Add application level status
  int upReplicasCount = 0;
  StringBuilder upReplicas = new StringBuilder();
  StringBuilder downReplicas = new StringBuilder();
  StringBuilder replicaHostNames = new StringBuilder();
  for (PeerEurekaNode node : peerEurekaNodes.getPeerEurekaNodes()) {
    if (replicaHostNames.length() > 0) {
      replicaHostNames.append(", ");
    }
    replicaHostNames.append(node.getServiceUrl());
    if (isReplicaAvailable(node.getServiceUrl())) {
      upReplicas.append(node.getServiceUrl()).append(',');
      upReplicasCount++;
    } else {
      downReplicas.append(node.getServiceUrl()).append(',');
    }
  }
  builder.add("registered-replicas", replicaHostNames.toString());
  builder.add("available-replicas", upReplicas.toString());
  builder.add("unavailable-replicas", downReplicas.toString());
  
  // Only set the healthy flag if a threshold has been configured.
  if (peerEurekaNodes.getMinNumberOfAvailablePeers() > -1) {
    builder.isHealthy(upReplicasCount >= peerEurekaNodes.getMinNumberOfAvailablePeers());
  }
  builder.withInstanceInfo(this.instanceInfo);
  return builder.build();
}
origin: com.netflix.eureka/eureka-core

public StatusInfo getStatusInfo() {
  StatusInfo.Builder builder = StatusInfo.Builder.newBuilder();
  // Add application level status
  int upReplicasCount = 0;
  StringBuilder upReplicas = new StringBuilder();
  StringBuilder downReplicas = new StringBuilder();
  StringBuilder replicaHostNames = new StringBuilder();
  for (PeerEurekaNode node : peerEurekaNodes.getPeerEurekaNodes()) {
    if (replicaHostNames.length() > 0) {
      replicaHostNames.append(", ");
    }
    replicaHostNames.append(node.getServiceUrl());
    if (isReplicaAvailable(node.getServiceUrl())) {
      upReplicas.append(node.getServiceUrl()).append(',');
      upReplicasCount++;
    } else {
      downReplicas.append(node.getServiceUrl()).append(',');
    }
  }
  builder.add("registered-replicas", replicaHostNames.toString());
  builder.add("available-replicas", upReplicas.toString());
  builder.add("unavailable-replicas", downReplicas.toString());
  
  // Only set the healthy flag if a threshold has been configured.
  if (peerEurekaNodes.getMinNumberOfAvailablePeers() > -1) {
    builder.isHealthy(upReplicasCount >= peerEurekaNodes.getMinNumberOfAvailablePeers());
  }
  builder.withInstanceInfo(this.instanceInfo);
  return builder.build();
}
com.netflix.eureka.utilStatusInfo$Builderadd

Javadoc

Add any application specific status data.

Popular methods of StatusInfo$Builder

  • build
    Build the StatusInfo. General information are automatically built here too.
  • isHealthy
  • newBuilder
  • <init>
  • withInstanceInfo

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now