overload: add a file-based injected resource monitor (#4298)

This allows injecting a synthetic resource pressure from a file, primarily intended for use in integration tests to force envoy into an overloaded state.

Testing: unit tests
Docs Changes: docs updated to reference new resource monitor

Signed-off-by: Elisha Ziskind eziskind@google.com

Mirrored from https://github.com/envoyproxy/envoy @ 12957a29bd2627bc0bba921603bd5869a449be47
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent c0a702b3c6
commit e19a09b8f8
  1. 1
      docs/BUILD
  2. 2
      envoy/config/overload/v2alpha/overload.proto
  3. 9
      envoy/config/resource_monitor/injected_resource/v2alpha/BUILD
  4. 16
      envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.proto

@ -58,6 +58,7 @@ proto_library(
"//envoy/config/ratelimit/v2:rls",
"//envoy/config/rbac/v2alpha:rbac",
"//envoy/config/resource_monitor/fixed_heap/v2alpha:fixed_heap",
"//envoy/config/resource_monitor/injected_resource/v2alpha:injected_resource",
"//envoy/config/trace/v2:trace",
"//envoy/config/transport_socket/capture/v2alpha:capture",
"//envoy/data/accesslog/v2:accesslog",

@ -21,6 +21,8 @@ message ResourceMonitor {
//
// * :ref:`envoy.resource_monitors.fixed_heap
// <envoy_api_msg_config.resource_monitor.fixed_heap.v2alpha.FixedHeapConfig>`
// * :ref:`envoy.resource_monitors.injected_resource
// <envoy_api_msg_config.resource_monitor.injected_resource.v2alpha.InjectedResourceConfig>`
string name = 1 [(validate.rules).string.min_bytes = 1];
// Configuration for the resource monitor being instantiated.

@ -0,0 +1,9 @@
load("//bazel:api_build_system.bzl", "api_proto_library_internal")
licenses(["notice"]) # Apache 2
api_proto_library_internal(
name = "injected_resource",
srcs = ["injected_resource.proto"],
visibility = ["//visibility:public"],
)

@ -0,0 +1,16 @@
syntax = "proto3";
package envoy.config.resource_monitor.injected_resource.v2alpha;
option go_package = "v2alpha";
import "validate/validate.proto";
// [#protodoc-title: Injected resource]
// The injected resource monitor allows injecting a synthetic resource pressure into Envoy
// via a text file, which must contain a floating-point number in the range [0..1] representing
// the resource pressure and be updated atomically by a symbolic link swap.
// This is intended primarily for integration tests to force Envoy into an overloaded state.
message InjectedResourceConfig {
string filename = 1 [(validate.rules).string.min_bytes = 1];
}
Loading…
Cancel
Save