17 Commits

Author SHA1 Message Date
Sargun Dhillon
b019f6ca54 Add Concurrency Limiter
This enables limiting concurrency. It is a naive approach which
will reject requests as soon as they exceed the maximum number
of in-flight requests.

It is a port of the following PR from the new watchdog code:
https://github.com/openfaas-incubator/of-watchdog/pull/54

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2019-06-16 15:23:20 +01:00
Alex Ellis
634ec22c8d Add RED metrics
- this PR adds metrics via Prometheus for instrumentation and
to move towards using HPAv2 / custom metrics in Kubernetes.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-04-04 09:05:17 +01:00
Alex Ellis (VMware)
a841e3d7f3 Fix bug reading default value for combine_output
The default should be set to true so we maintain backwards.
compatibility.
readconfig.go was altered due to bug reading default value. This was
tested by adding unit tests to readconfig_test.go for positive and
negative scenarios.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-22 11:23:49 +00:00
Alex Ellis (VMware)
3031d0e1c2 Feature: combine_output to control stdout/stderr
This enables an often-requested feature to separate stderr
from stdout within function responses. New flag combine_output is on
by default to match existing behaviour. When combine_output is set
to false it redirects stderr to the container logs rather than
combining it into the function response.

Tested with unit tests for default behaviour and new behaviour.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-17 20:59:47 +00:00
Alex Ellis (VMware)
70e9a83e87 Allow override of HTTP port via env-var
HTTP port can now be overriden through use of "port" environmental
variable.

Prefer messaging "want" over "wanted" in error messages, this is more
idiomatic Golang.

Move away from Go ARMv6 (RPi Zero) and give ARMv7 as a minimum
version for release binaries.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-17 20:18:09 +00:00
Vivek Singh
62900cf46e added go duration support for read_timeout, write_timeout, exec_timeout in watchdog
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

updated testcases

applied go fmt to readconfig

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

added requested changes in code review

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2018-02-27 18:05:55 +00:00
Burton Rheutan
b9f59f5150 Fixes 251. Set debug_write to false by default. Added log output of byte count when debug is false. Updated tests to match new default
Signed-off-by: Burton Rheutan <rheutan7@gmail.com>
2017-10-23 15:13:30 +01:00
Alex Ellis
c5815d36ab add_missing_mit_header_27_aug
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-27 22:37:19 +01:00
Alex Ellis
4d05896798 Watchdog refurbishments
- Watchdog - allow new methods with and without body.
- Enforce hard-timeout via exec_timeout variable.
- Correct bug in timeouts for read/write of HTTP.
- Documentation for new verbs and hard timeout.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-07-07 08:49:11 +01:00
Alex
cc0d351e69 Watchdog - enable forwarding of HTTP headers via CGI-like env vars. 2017-05-09 09:13:42 +01:00
Alex Ellis
f958e99bdc Allow override of contentType response from watchdog. (#46) 2017-04-10 22:18:37 +01:00
Alex Ellis
469fc690da Fix issue in watchdog - not reading false config overrides. 2017-04-05 09:13:18 +01:00
Alex Ellis
93bdfba4b2 Rename marshal_request for watchdog, enable lock-file for healthcheck CMD. 2017-04-05 09:13:18 +01:00
Alex
c705cd8e33 Forward client HTTP headers through pipeline 2017-03-31 20:40:25 +01:00
Alex Ellis
04be17ce49 Add marshall_request to watchdog for passing header to functions 2017-03-31 20:40:25 +01:00
Alex
5db6013861 Use time / duration for config 2017-01-24 20:06:22 +00:00
Alex
ed47c36d59 Add timeouts and unit test config. 2017-01-24 20:00:15 +00:00