-
Notifications
You must be signed in to change notification settings - Fork 27
/
disruption_configuration.go
29 lines (23 loc) · 1.17 KB
/
disruption_configuration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2024 Datadog, Inc.
package calculations
// DisruptionConfiguration configures the DisruptionListener to chaos test endpoints of a gRPC server.
type DisruptionConfiguration map[TargetEndpoint]EndpointConfiguration
// EndpointConfiguration configures endpoints that the DisruptionListener chaos tests on a gRPC server.
// The Alterations maps integers from 0 to 100 to alteration configurations.
type EndpointConfiguration struct {
TargetEndpoint TargetEndpoint
Alterations []AlterationConfiguration
}
// AlterationConfiguration contains either an ErrorToReturn or an OverrideToReturn for a given
// gRPC query to the disrupted service.
type AlterationConfiguration struct {
ErrorToReturn string
OverrideToReturn string
}
// QueryPercent is an integer representing the percentage odds that a query for an endpoint is affected by a certain alteration.
type QueryPercent int
// TargetEndpoint is a string of the format /package.service/method.
type TargetEndpoint string