Skip to content

Commit

Permalink
Tweak demo
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Oct 25, 2021
1 parent b5f4551 commit 72bc962
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ ENV NEW_RELIC_CONFIG_FILE=/newrelic.ini

# Start with script
ENTRYPOINT [ "/entrypoint.sh" ]

8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ services:
image: python-source-context-demo:latest
build: .
environment:
NEW_RELIC_DEVELOPER_MODE: $NEW_RELIC_DEVELOPER_MODE
NEW_RELIC_LICENSE_KEY: $NEW_RELIC_LICENSE_KEY
NEW_RELIC_HOST: $NEW_RELIC_HOST
# Optional vars
NEW_RELIC_DEVELOPER_MODE: ${NEW_RELIC_DEVELOPER_MODE:-}
NEW_RELIC_HOST: ${NEW_RELIC_HOST:-}
ports:
- 127.0.0.1:8000:8000
volumes:
- "./cron.log:/var/log/cron.log"
- "./python.log:/var/log/python.log"
- "./logs:/var/log"
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

newrelic-admin run-program gunicorn main:app -w 3 -t 120 >>/var/log/python.log 2>&1 &
locust --headless --users 3 --spawn-rate 1 -f /locustfile.py
locust --headless --users 3 --spawn-rate 1 -f /locustfile.py >>/var/log/locust.log 2>&1
6 changes: 5 additions & 1 deletion locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ def hello_world(self):
self.client.get("/")

@task(1)
def error(self):
def simple_error(self):
self.client.get("/error")

@task(1)
def external_error(self):
self.client.get("/external/error")
4 changes: 2 additions & 2 deletions newrelic.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[newrelic]
app_name = python_source_context_demo
log_level = info
log_file = stdout
; audit_log_file = audit.log
log_file = /var/log/agent.log
audit_log_file = /var/log/audit.log

startup_timeout = 10.0
transaction_tracer.explain_threshold = 0.0
Expand Down

0 comments on commit 72bc962

Please sign in to comment.