Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.github.kristofa.brave.zipkin;
  
Optional parameters for ZipkinSpanCollector.

If not specified we will use the default values. We support following parameters:

  • queue size: Size of the queue that is used as buffer between producers of spans and the thread(s) that submit the spans to collector.
  • batch size: The maximum number of spans that is submitted at once to collector of spans.
  • number of threads: The number of parallel threads for submitting spans to collector.
  • socket time out: Time in milliseconds after which our socket connections will time out. When it times out an exception will be thrown.
  • fail on setup: Indicates if ZipkinSpanCollector should fail on creation when connection with collector can't be established or just log error message.

Author(s):
kristof
 
 public class ZipkinSpanCollectorParams {
 
     public int DEFAULT_QUEUE_SIZE = 200;
     public int DEFAULT_BATCH_SIZE = 10;
     public int DEFAULT_NR_OF_THREADS = 1;
     public int DEFAULT_SOCKET_TIMEOUT = 5000;
 
     private int queueSize;
     private int batchSize;
     private int nrOfThreads;
     private int socketTimeout;
     private boolean failOnSetup = true;

    
Create a new instance with default values.
 
     public ZipkinSpanCollectorParams() {
          = ;
          = ;
          = ;
     }

    
Gets queue size.

Returns:
queue size.
 
     public int getQueueSize() {
         return ;
     }

    
Sets the size of the queue that is used as buffer between producers of spans and the thread(s) that submit the spans to collector.

Parameters:
queueSize Queue size.
 
     public void setQueueSize(final int queueSize) {
         Validate.isTrue(queueSize > 0);
         this. = queueSize;
     }

    
Gets the maximum batch size.

Returns:
Maximum queue size.
 
     public int getBatchSize() {
         return ;
     }

    
Sets the batch size. The batch size is the maximum number of spans that is submitted at once to the collector.

Parameters:
batchSize Maximum batch size.
 
     public void setBatchSize(final int batchSize) {
         Validate.isTrue(batchSize > 0);
         this. = batchSize;
     }

    
Gets the number of threads.

Returns:
Number of threads.
 
     public int getNrOfThreads() {
         return ;
     }

    
Sets the number of parallel threads for submitting spans to collector.

Parameters:
nrOfThreads Number of parallel threads for submitting spans to collector.
 
     public void setNrOfThreads(final int nrOfThreads) {
         Validate.isTrue(nrOfThreads > 0);
        this. = nrOfThreads;
    }

    
Gets the socket time out.

Returns:
Returns the socket time out in milliseconds.
    public int getSocketTimeout() {
        return ;
    }

    
Sets the socket time out in milliseconds.

Parameters:
socketTimeout Socket time out in milliseconds. Should be >= 100;
    public void setSocketTimeout(final int socketTimeout) {
        Validate.isTrue(socketTimeout >= 100);
        this. = socketTimeout;
    }

    
Sets fail on setup value.

Parameters:
failOnSetup true in case ZipkinSpanCollector will throw exception when connection can't be established during setup. Or false in case we should log message but not throw exception.
    public void setFailOnSetup(final boolean failOnSetup) {
        this. = failOnSetup;
    }

    
Indicates if ZipkinSpanCollector should fail on creation when connection with collector can't be established.

Returns:
true in case ZipkinSpanCollector will throw exception when connection can't be established during setup. Or false in case we should log message but not throw exception. Default value = true.
    public boolean failOnSetup() {
        return ;
    }
New to GrepCode? Check out our FAQ X