diff --git a/Dockerfile b/Dockerfile index 8ce5e45..3d4fd30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,3 +10,5 @@ COPY . . EXPOSE 8080 ENV PORT=8080 + +CMD ["npm", "run", "measure"] \ No newline at end of file diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..f97a5cf --- /dev/null +++ b/compose.yml @@ -0,0 +1,46 @@ +--- +version: "3" + +services: + app: + build: + context: . + ports: + - "8080:8080" + environment: + PORT: 8080 + +volumes: + node_modules: + +# services: +# Small_load_Container: +# image: node:20-alpine +# # working_dir: /usr/src/app +# ports: +# - 9000:8080 +# setup-commands: +# - whoami + +# High_load_Container: +# image: node:20-alpine +# # working_dir: /usr/src/app +# ports: +# - 9001:8080 +# setup-commands: +# - whoami + +# flow: +# - name: Load 1 +# container: Small_load_Container +# commands: +# - type: console +# command: node experiments/example.js -n 1 +# detach: true +# note: Running Example Code with 1 detached +# - name: Load 100 +# container: High_load_Container +# commands: +# - type: console +# command: node experiments/example.js -n 100 +# note: Running Example Code with 100 detached \ No newline at end of file diff --git a/package.json b/package.json index 80334a2..48c421d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "memory usage" ], "scripts": { - "test": "mocha test/*.test.js" + "test": "mocha test/*.test.js", + "measure": "node experiments/example.js" }, "author": "Suman Kunwar", "license": "MIT", diff --git a/usage_scenario.yml b/usage_scenario.yml deleted file mode 100644 index 151d63b..0000000 --- a/usage_scenario.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: Green-Coding-Metrics -author: Suman Kunwar -version: 1 -description: Scenario to test file right usage. - -services: - Small_load_Container: - image: node:20-alpine - # working_dir: /usr/src/app - ports: - - 9000:8080 - setup-commands: - - whoami - - High_load_Container: - image: node:20-alpine - # working_dir: /usr/src/app - ports: - - 9001:8080 - setup-commands: - - whoami - -flow: - - name: Load 1 - container: Small_load_Container - commands: - - type: console - command: node experiments/example.js -n 1 - detach: true - note: Running Example Code with 1 detached - - name: Load 100 - container: High_load_Container - commands: - - type: console - command: node experiments/example.js -n 100 - note: Running Example Code with 100 detached \ No newline at end of file