-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from esl/amoc_core
Amoc core
- Loading branch information
Showing
54 changed files
with
261 additions
and
1,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,3 @@ jobs: | |
run: make integration_test | ||
env: | ||
OTP_RELEASE: ${{ matrix.otp_vsn }} | ||
REBAR_RELEASE: ${{ matrix.rebar_vsn }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,20 @@ | ||
FROM phusion/baseimage:focal-1.0.0 as base-image | ||
FROM base-image as amoc-build | ||
ARG otp_vsn=25.3 | ||
FROM erlang:${otp_vsn}-slim AS builder | ||
MAINTAINER Erlang Solutions <[email protected]> | ||
|
||
RUN apt-get update | ||
RUN apt-get -y install gnupg2 | ||
WORKDIR /amoc_build | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
ARG otp_vsn=24.0 | ||
ARG rebar_vsn=3.16.1 | ||
COPY ./rebar.config ./rebar.lock ./ | ||
RUN rebar3 deps && rebar3 compile -d | ||
|
||
ADD https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb /tmp/ | ||
RUN dpkg -i /tmp/erlang-solutions_2.0_all.deb | ||
RUN apt-get update | ||
COPY ./integration_test integration_test | ||
COPY ./scenarios scenarios | ||
COPY ./priv priv | ||
COPY ./rel rel | ||
COPY ./src src | ||
|
||
RUN apt-get -y install esl-erlang=1:${otp_vsn}-1 | ||
RUN rebar3 as demo release | ||
|
||
RUN apt-get -y install git make wget | ||
ENV PATH "/amoc_build/_build/demo/rel/amoc/bin:${PATH}" | ||
|
||
COPY . /amoc_build | ||
|
||
ADD https://github.com/erlang/rebar3/releases/download/${rebar_vsn}/rebar3 /bin | ||
RUN chmod u+x /bin/rebar3 | ||
|
||
RUN cd /amoc_build && \ | ||
git clean -ffxd && \ | ||
make rel | ||
|
||
FROM base-image | ||
|
||
RUN useradd -ms /bin/bash amoc | ||
|
||
COPY --from=amoc-build /amoc_build/_build/demo/rel/amoc/ /home/amoc/amoc/ | ||
COPY --from=amoc-build /amoc_build/scenarios /amoc_build/scenarios | ||
|
||
# It seems hub.docker.com does not support --chown param to COPY directive | ||
RUN chown -R amoc:amoc /home/amoc/amoc | ||
|
||
EXPOSE 4000 | ||
|
||
RUN mkdir /etc/service/amoc | ||
COPY docker/amoc.sh /etc/service/amoc/run | ||
|
||
CMD ["/sbin/my_init"] | ||
CMD ["amoc", "foreground"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## Telemetry | ||
|
||
Amoc also exposes the following telemetry events: | ||
|
||
### Scenario | ||
|
||
A telemetry span of a full scenario execution | ||
```erlang | ||
event_name: [amoc, scenario, user] | ||
measurements: #{} | ||
metadata: #{} | ||
``` | ||
|
||
### Controller | ||
|
||
Indicates the number of users added or removed | ||
```erlang | ||
event_name: [amoc, controller, users] | ||
measurements: #{count => non_neg_integer()} | ||
metadata: #{type => add | remove} | ||
``` | ||
|
||
### Throttle | ||
|
||
#### Rate | ||
|
||
Raised when a throttle mechanism is initialised or its configured rate is changed. | ||
|
||
```erlang | ||
event_name: [amoc, throttle, rate] | ||
measurements: #{rate => non_neg_integer()} | ||
metadata: #{name => atom()} | ||
``` | ||
|
||
#### Request | ||
|
||
Raised when a process client requests to be allowed pass through a throttled mechanism. | ||
|
||
```erlang | ||
event_name: [amoc, throttle, request] | ||
measurements: #{count => 1} | ||
metadata: #{name => atom()} | ||
``` | ||
|
||
#### Execute | ||
|
||
Raised when a process client is allowed to execute after a throttled mechanism. | ||
|
||
```erlang | ||
event_name: [amoc, throttle, execute] | ||
measurements: #{count => 1} | ||
metadata: #{name => atom()} | ||
``` | ||
|
||
### Coordinate | ||
|
||
Indicates when a coordinating event was raised, like a callback index being reached or a timeout being triggered | ||
|
||
#### Event | ||
```erlang | ||
event_name: [amoc, coordinator, event] | ||
measurements: #{count => 1} | ||
metadata: #{type => atom()} | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,31 @@ | ||
version: "3.4" | ||
|
||
x-amoc-defaults: &amoc-defaults | ||
image: "amoc:latest" | ||
build: | ||
context: ../ | ||
dockerfile: Dockerfile | ||
networks: | ||
- amoc-test-network | ||
volumes: | ||
- type: bind | ||
source: ./extra_code_paths | ||
target: /extra_code_paths | ||
environment: | ||
AMOC_GRAPHITE_HOST: '"graphite"' | ||
AMOC_NODES: "['amoc@amoc-master']" | ||
AMOC_EXTRA_CODE_PATHS: '["/extra_code_paths/test1", "/extra_code_paths/test2"]' | ||
healthcheck: | ||
test: "/home/amoc/amoc/bin/amoc status" | ||
test: "amoc status" | ||
|
||
services: | ||
amoc-master: | ||
<<: *amoc-defaults | ||
hostname: "amoc-master" | ||
ports: | ||
- "4000:4000" | ||
amoc-worker-1: &amoc-worker | ||
<<: *amoc-defaults | ||
hostname: "amoc-worker-1" | ||
ports: | ||
- "4001:4000" | ||
amoc-worker-2: | ||
amoc-worker-2: | ||
<<: *amoc-defaults | ||
hostname: "amoc-worker-2" | ||
ports: | ||
- "4002:4000" | ||
amoc-worker-3: | ||
amoc-worker-3: | ||
<<: *amoc-defaults | ||
hostname: "amoc-worker-3" | ||
ports: | ||
- "4003:4000" | ||
graphite: | ||
image: "graphiteapp/graphite-statsd:1.1.7-2" | ||
ports: | ||
- "8080:80" | ||
networks: | ||
- amoc-test-network | ||
grafana: | ||
image: "grafana/grafana:6.7.3" | ||
ports: | ||
- "3000:3000" | ||
networks: | ||
- amoc-test-network | ||
networks: | ||
amoc-test-network: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.