REDIS_SPAN_ERROR_RATE
: float [0, 1], Percentage of redis spans that will be flagged as an error
These environment variables are used to simulate access to an external DB for some of the requests. The access to DB is wrapped by OpenTelemetry spans and the backend infers an external DB from these spans.
EXTERNAL_DB_ACCESS_RATE
: float [0, 1], percentage of redis spans that will be turned into external database spansEXTERNAL_DB_ERROR_RATE
: float [0, 1], percentage of external DB access spans that will report errorEXTERNAL_DB_MAX_DURATION_MILLIS
: int, artificial maximum delay randomly added to external database spans (mock value)EXTERNAL_DB_NAME
: string, name of external database
These environment variables are used to trigger behaviors on the application that affect its performance characteristics. Each optimization affects latency, CPU, and memory in different ways. Keep that in mind when interpreting their effect. All these environment variables are boolean.
FIX_EXCESSIVE_ALLOCATION
: bool, controls if the excessive allocation per request should be happening or notFIX_SLOW_LEAK
: bool, controls if a slowly growing memory leak is going to be happening or notOPTIMIZE_CPU
: bool, controls if the CPU is going to be efficiently used during input validationOPTIMIZE_BLOCKING
: bool, controls if the code is going to do some blocking to retrieve a handle to the Redis DB
Use the dotnet
tool to build the project locally:
$ dotnet build
After source changes are done, build the Docker image and validate it using docker-compose
and the test project:
$ pushd ./tests/
$ docker build -t cartservice ./..
$ docker-compose up -d
$ dotnet test .
$ docker-compose down
$ popd
If you want to send data to the backend set the following environment below when starting the docker-compose
:
SPLUNK_ACCESS_TOKEN
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=