github.com/MetalBlockchain/metalgo@v1.11.9/snow/networking/router/health.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package router
     5  
     6  import "time"
     7  
     8  // HealthConfig describes parameters for router health checks.
     9  type HealthConfig struct {
    10  	// Reports unhealthy if we drop more than [MaxDropRate] of messages
    11  	MaxDropRate float64 `json:"maxDropRate"`
    12  
    13  	// Halflife of averager used to calculate the message drop rate
    14  	// Must be > 0.
    15  	// Larger value --> Drop rate affected less by recent messages
    16  	MaxDropRateHalflife time.Duration `json:"maxDropRateHalflife"`
    17  
    18  	// Reports unhealthy if more than this number of requests are outstanding.
    19  	// Must be > 0
    20  	MaxOutstandingRequests int `json:"maxOutstandingRequests"`
    21  
    22  	// Reports unhealthy if there is a request outstanding for longer than this
    23  	MaxOutstandingDuration time.Duration `json:"maxOutstandingDuration"`
    24  
    25  	// Reports unhealthy if there is at least 1 outstanding not processed
    26  	// before this mark
    27  	MaxRunTimeRequests time.Duration `json:"maxRunTimeRequests"`
    28  }