Class TaskQueueStats.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<TaskQueueStats.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
io.temporal.api.taskqueue.v1.TaskQueueStats.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, TaskQueueStatsOrBuilder, Cloneable
Enclosing class:
TaskQueueStats

public static final class TaskQueueStats.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder> implements TaskQueueStatsOrBuilder
 TaskQueueStats contains statistics about task queue backlog and activity.

 For workflow task queue type, this result is partial because tasks sent to sticky queues are not included. Read
 comments above each metric to understand the impact of sticky queue exclusion on that metric accuracy.
 
Protobuf type temporal.api.taskqueue.v1.TaskQueueStats
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • clear

      public TaskQueueStats.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • getDefaultInstanceForType

      public TaskQueueStats getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public TaskQueueStats build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public TaskQueueStats buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public TaskQueueStats.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • setField

      public TaskQueueStats.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • clearField

      public TaskQueueStats.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • clearOneof

      public TaskQueueStats.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • setRepeatedField

      public TaskQueueStats.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • addRepeatedField

      public TaskQueueStats.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • mergeFrom

      public TaskQueueStats.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TaskQueueStats.Builder>
    • mergeFrom

      public TaskQueueStats.Builder mergeFrom(TaskQueueStats other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • mergeFrom

      public TaskQueueStats.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TaskQueueStats.Builder>
      Throws:
      IOException
    • getApproximateBacklogCount

      public long getApproximateBacklogCount()
       The approximate number of tasks backlogged in this task queue. May count expired tasks but eventually
       converges to the right value. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, the inaccuracy becomes less significant as the backlog size
       grows.
       
      int64 approximate_backlog_count = 1;
      Specified by:
      getApproximateBacklogCount in interface TaskQueueStatsOrBuilder
      Returns:
      The approximateBacklogCount.
    • setApproximateBacklogCount

      public TaskQueueStats.Builder setApproximateBacklogCount(long value)
       The approximate number of tasks backlogged in this task queue. May count expired tasks but eventually
       converges to the right value. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, the inaccuracy becomes less significant as the backlog size
       grows.
       
      int64 approximate_backlog_count = 1;
      Parameters:
      value - The approximateBacklogCount to set.
      Returns:
      This builder for chaining.
    • clearApproximateBacklogCount

      public TaskQueueStats.Builder clearApproximateBacklogCount()
       The approximate number of tasks backlogged in this task queue. May count expired tasks but eventually
       converges to the right value. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, the inaccuracy becomes less significant as the backlog size
       grows.
       
      int64 approximate_backlog_count = 1;
      Returns:
      This builder for chaining.
    • hasApproximateBacklogAge

      public boolean hasApproximateBacklogAge()
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
      Specified by:
      hasApproximateBacklogAge in interface TaskQueueStatsOrBuilder
      Returns:
      Whether the approximateBacklogAge field is set.
    • getApproximateBacklogAge

      public com.google.protobuf.Duration getApproximateBacklogAge()
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
      Specified by:
      getApproximateBacklogAge in interface TaskQueueStatsOrBuilder
      Returns:
      The approximateBacklogAge.
    • setApproximateBacklogAge

      public TaskQueueStats.Builder setApproximateBacklogAge(com.google.protobuf.Duration value)
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
    • setApproximateBacklogAge

      public TaskQueueStats.Builder setApproximateBacklogAge(com.google.protobuf.Duration.Builder builderForValue)
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
    • mergeApproximateBacklogAge

      public TaskQueueStats.Builder mergeApproximateBacklogAge(com.google.protobuf.Duration value)
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
    • clearApproximateBacklogAge

      public TaskQueueStats.Builder clearApproximateBacklogAge()
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
    • getApproximateBacklogAgeBuilder

      public com.google.protobuf.Duration.Builder getApproximateBacklogAgeBuilder()
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
    • getApproximateBacklogAgeOrBuilder

      public com.google.protobuf.DurationOrBuilder getApproximateBacklogAgeOrBuilder()
       Approximate age of the oldest task in the backlog based on the creation time of the task at the head of
       the queue. Can be relied upon for scaling decisions.
      
       Special note for workflow task queue type: this metric does not count sticky queue tasks. However, because
       those tasks only remain valid for a few seconds, they should not affect the result when backlog is older than
       few seconds.
       
      .google.protobuf.Duration approximate_backlog_age = 2;
      Specified by:
      getApproximateBacklogAgeOrBuilder in interface TaskQueueStatsOrBuilder
    • getTasksAddRate

      public float getTasksAddRate()
       The approximate tasks per second added to the task queue, averaging the last 30 seconds. These includes tasks
       whether or not they were added to/dispatched from the backlog or they were dispatched immediately without going
       to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_add_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_add_rate = 3;
      Specified by:
      getTasksAddRate in interface TaskQueueStatsOrBuilder
      Returns:
      The tasksAddRate.
    • setTasksAddRate

      public TaskQueueStats.Builder setTasksAddRate(float value)
       The approximate tasks per second added to the task queue, averaging the last 30 seconds. These includes tasks
       whether or not they were added to/dispatched from the backlog or they were dispatched immediately without going
       to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_add_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_add_rate = 3;
      Parameters:
      value - The tasksAddRate to set.
      Returns:
      This builder for chaining.
    • clearTasksAddRate

      public TaskQueueStats.Builder clearTasksAddRate()
       The approximate tasks per second added to the task queue, averaging the last 30 seconds. These includes tasks
       whether or not they were added to/dispatched from the backlog or they were dispatched immediately without going
       to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_add_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_add_rate = 3;
      Returns:
      This builder for chaining.
    • getTasksDispatchRate

      public float getTasksDispatchRate()
       The approximate tasks per second dispatched from the task queue, averaging the last 30 seconds. These includes
       tasks whether or not they were added to/dispatched from the backlog or they were dispatched immediately without
       going to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_dispatch_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_dispatch_rate = 4;
      Specified by:
      getTasksDispatchRate in interface TaskQueueStatsOrBuilder
      Returns:
      The tasksDispatchRate.
    • setTasksDispatchRate

      public TaskQueueStats.Builder setTasksDispatchRate(float value)
       The approximate tasks per second dispatched from the task queue, averaging the last 30 seconds. These includes
       tasks whether or not they were added to/dispatched from the backlog or they were dispatched immediately without
       going to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_dispatch_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_dispatch_rate = 4;
      Parameters:
      value - The tasksDispatchRate to set.
      Returns:
      This builder for chaining.
    • clearTasksDispatchRate

      public TaskQueueStats.Builder clearTasksDispatchRate()
       The approximate tasks per second dispatched from the task queue, averaging the last 30 seconds. These includes
       tasks whether or not they were added to/dispatched from the backlog or they were dispatched immediately without
       going to the backlog (sync-matched).
      
       The difference between `tasks_add_rate` and `tasks_dispatch_rate` is a reliable metric for the rate at which
       backlog grows/shrinks.
      
       Note: the actual tasks delivered to the workers may significantly be higher than the numbers reported by
       tasks_dispatch_rate, because:
       - Tasks can be sent to workers without going to the task queue. This is called Eager dispatch. Eager dispatch is
         enable for activities by default in the latest SDKs.
       - Tasks going to Sticky queue are not accounted for. Note that, typically, only the first workflow task of each
         workflow goes to a normal queue, and the rest workflow tasks go to the Sticky queue associated with a specific
         worker instance.
       
      float tasks_dispatch_rate = 4;
      Returns:
      This builder for chaining.
    • getRateLimitingActive

      public boolean getRateLimitingActive()
       Whether rate limiting blocked any dispatches within the recent observation window (approximately
       30 seconds). When true, adding more workers will not increase throughput — the bottleneck is the
       rate limit, not worker count. This field is useful for auto-scaling systems to avoid unnecessary
       scale-up.
       
      bool rate_limiting_active = 5;
      Specified by:
      getRateLimitingActive in interface TaskQueueStatsOrBuilder
      Returns:
      The rateLimitingActive.
    • setRateLimitingActive

      public TaskQueueStats.Builder setRateLimitingActive(boolean value)
       Whether rate limiting blocked any dispatches within the recent observation window (approximately
       30 seconds). When true, adding more workers will not increase throughput — the bottleneck is the
       rate limit, not worker count. This field is useful for auto-scaling systems to avoid unnecessary
       scale-up.
       
      bool rate_limiting_active = 5;
      Parameters:
      value - The rateLimitingActive to set.
      Returns:
      This builder for chaining.
    • clearRateLimitingActive

      public TaskQueueStats.Builder clearRateLimitingActive()
       Whether rate limiting blocked any dispatches within the recent observation window (approximately
       30 seconds). When true, adding more workers will not increase throughput — the bottleneck is the
       rate limit, not worker count. This field is useful for auto-scaling systems to avoid unnecessary
       scale-up.
       
      bool rate_limiting_active = 5;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final TaskQueueStats.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>
    • mergeUnknownFields

      public final TaskQueueStats.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TaskQueueStats.Builder>