Skip to content

Commit

Permalink
Add env example files (#6)
Browse files Browse the repository at this point in the history
* Add uptime monitoring

* remove test file

* Add granular checks, uptime monitoring and latency graph

* update latency & add example env files

* testing a rebase

* update env example files
  • Loading branch information
kenny-io authored May 13, 2024
1 parent 9e944cc commit 270d066
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 19 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# PORT = 3002
# Port to run the server on
1 change: 1 addition & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The services and their expected responses are contained in the `endpoints.jsoon`
To run this server locally, follow these steps:

* Clone the repository with `git clone https://github.com/shardeum/network-status.git`
* Change into the backend directory with `cd backend`
* Install the dependencies with `npm install`
* Run the local dev server with: `npm start`
* This should start the server on port 3002 from where it will feed data to Prometheus.
Expand Down
3 changes: 1 addition & 2 deletions backend/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
{
"url": "https://explorer-sphinx.shardeum.orgdfsgs/",
"name": "Explorer",
"help": "This is the Shardeum Explorer",
"expectedResponse": "The Shardeum Betanet Explorer"
"help": "This is the Shardeum Explorer"

},
{
Expand Down
1 change: 1 addition & 0 deletions backend/services/servicecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class HealthChecker {
this.startPeriodicChecks();
}
flattenEndpoints(urls: any[]) {
// If an endpoint is part of a group, it is flattened so that each service can be checked individually.
// If an endpoint is part of a group, it is flattened so that each service can be checked individually.
return urls.flatMap(endpoint => 'servers' in endpoint ? endpoint.servers : [endpoint]);
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# http://localhost:9090 this is where your local prometheus instance is running
# NEXT_PUBLIC_PROMETHEUS_URL_RANGE = "http://localhost:9090/api/v1/query_range"
# NEXT_PUBLIC_PROMETHEUS_URL = "http://localhost:9090/api/v1/query?query=Shardeum"
2 changes: 1 addition & 1 deletion frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env*.local
.env.local

# vercel
.vercel
Expand Down
17 changes: 1 addition & 16 deletions frontend/src/app/latency/latencygraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default function LatencyGraph({ data, name }: Readonly<{ data: any, name:
const details = {
chart: {
id: name,

type: "line",
animations: {
enabled: true,
Expand All @@ -14,9 +13,6 @@ export default function LatencyGraph({ data, name }: Readonly<{ data: any, name:
speed: 2000
}
},
toolbar: {
show: false
},

},

Expand All @@ -26,18 +22,10 @@ export default function LatencyGraph({ data, name }: Readonly<{ data: any, name:
},
yaxis: [
{
axisTicks: {
show: true
},
axisBorder: {
show: true,
color: "#247BA0"
},
labels: {
style: {
colors: "#247BA0"
}
},
title: {
text: "Response time (s)",
style: {
Expand All @@ -48,14 +36,11 @@ export default function LatencyGraph({ data, name }: Readonly<{ data: any, name:
}
}
],
dataLabels: {
enabled: false
},

stroke: {
curve: 'straight',
},
title: {
// text: 'Latency Graph',
text: name,
align: 'left'
},
Expand Down

0 comments on commit 270d066

Please sign in to comment.