Skip to content

Commit

Permalink
Created script to collect website metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarengathomas committed Jan 2, 2025
1 parent 2c7ba7e commit 91f7bce
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 1,562 deletions.
1 change: 1 addition & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ABSINTHE_API_KEY=
ABSINTHE_EVENT_NAME=
TESTNET=true
HOURS_INTERVAL=4
METRICS_FILE_PATH='./metrics.json'
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## -*- docker-image-name: "hemilabs/hemiconnector-metrics:1.0.0" -*-
FROM node:20.16.0-alpine3.20@sha256:eb8101caae9ac02229bd64c024919fe3d4504ff7f329da79ca60a04db08cef52

RUN mkdir -p /usr/src/app

WORKDIR /usr/src/app

COPY package*.json .

RUN npm ci --production

COPY . .

RUN npm run build

CMD [ "npm", "run", "collect-metrics"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ The environment variables are defined in the `.env` file. The following variable
- `ABSINTHE_EVENT_NAME`: The Absinthe Event Name to send in the points requests
- `TESTNET`: Boolean value to set if the scripts should run on testnet or no
- `HOURS_INTERVAL`: Interval in hours to search for blocks/transactions that have smart contracts creation
- `METRICS_FILE_PATH`: Path of the Website metrics file (e.g. `/usr/src/app/metrics.json`).

Example of the .env file

Expand All @@ -87,6 +88,7 @@ ABSINTHE_API_KEY=
ABSINTHE_EVENT_NAME=
TESTNET=
HOURS_INTERVAL=
METRICS_FILE_PATH=
```

## Contribution
Expand Down
Loading

0 comments on commit 91f7bce

Please sign in to comment.