Skip to main content

config.go

config.go - Overview

  1. Overview This file defines the configuration structure and default values for the alert manager batcher.

  2. Detailed Documentation

Config

  • Purpose: Configuration structure for the alert manager batcher, defining capacity and batch size.
  • Parameters: None
  • Returns: None
type Config struct {
// Capacity is the maximum number of alerts that can be buffered in the batcher.
Capacity int

// Size is the number of alerts to send in each batch.
Size int
}
  • Capacity:
    • Purpose: The maximum number of alerts that can be buffered.
    • Type: int
    • Description: Determines the maximum number of alerts the batcher can hold before sending.
  • Size:
    • Purpose: The number of alerts to include in each batch.
    • Type: int
    • Description: Specifies the number of alerts to be sent together in a single batch.

NewConfig

  • Purpose: Creates and returns a new Config struct with default values for Capacity and Size.
  • Parameters: None
  • Returns:
    • Type: Config
    • Description: A Config struct initialized with Capacity set to 10000 and Size set to 64.
func NewConfig() Config {
return Config{
Capacity: 10000,
Size: 64,
}
}

Include in Getting Started: NO