Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python loadgenerator memory leak #816

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ release.
([#810](https://github.com/open-telemetry/opentelemetry-demo/pull/810))
* Fix bug in shipping calculation
([#814](https://github.com/open-telemetry/opentelemetry-demo/pull/814))
* Fix loadgenerator memory leak
([#816](https://github.com/open-telemetry/opentelemetry-demo/pull/816))

## v0.1.0

Expand Down
15 changes: 5 additions & 10 deletions src/loadgenerator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:3.11-slim-buster as base
FROM locustio/locust:2.15.1

FROM base as builder
RUN apt-get -qq update \
&& apt-get install -y --no-install-recommends g++ \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app/

COPY ./src/loadgenerator/requirements.txt .
RUN pip install --prefix="/reqs" -r requirements.txt
RUN pip install -r requirements.txt

FROM base
WORKDIR /usr/src/app/
COPY --from=builder /reqs /usr/local
COPY ./src/loadgenerator/locustfile.py .
COPY ./src/loadgenerator/people.json .
ENTRYPOINT locust

ENTRYPOINT ["locust"]
1 change: 0 additions & 1 deletion src/loadgenerator/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
people_file = open('people.json')
people = json.load(people_file)


class WebsiteUser(HttpUser):
wait_time = between(1, 10)

Expand Down