Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva64 committed Nov 12, 2024
2 parents 377d99b + ad05eca commit 978f950
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions gateway/dataManager/alerter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ func (alerter *Alerter) CheckHealthParameter(param string, sample Sample) bool {

switch param {
case "temperature":
isAbnormal = sample.Value < 36.0 || sample.Value > 38
isAbnormal = sample.Value < 36.1 || sample.Value > 42
message = fmt.Sprintf("Alert! Abnormal %s: %.2f°C", param, sample.Value)
case "acceleration":
isAbnormal = sample.Value > 500
message = fmt.Sprintf("Alert! Abnormal %s: %.2f m/s²", param, sample.Value)
case "glucose":
isAbnormal = sample.Value < 50 || sample.Value > 140
isAbnormal = sample.Value < 20 || sample.Value > 90
message = fmt.Sprintf("Alert! Abnormal %s: %.2f mg/dL", param, sample.Value)
case "heartrate":
isAbnormal = sample.Value < 50 || sample.Value > 120
isAbnormal = sample.Value < 50 || sample.Value > 150
message = fmt.Sprintf("Alert! Abnormal %s: %.2f BPM", param, sample.Value)
default:
fmt.Println("Unknown parameter:", param)
Expand Down
12 changes: 6 additions & 6 deletions gateway/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
- rabbitmq
networks:
- internal
- poulet_internal
#- poulet_internal

data-manager:
build:
Expand All @@ -30,14 +30,14 @@ services:
- RABBITMQ_PASSWORD=guest
- NOTIFICATION_SERVER=http://doctor.al.apoorva64.com
- CLIENT_INFO_SERVER=http://doctor.al.apoorva64.com
- GATEWAY_ID=671ec1f0c368aa3dd8f66649
- GATEWAY_ID=6733c47743bcd67dd1c3bb85
volumes:
- /etc/localtime:/etc/localtime:ro
depends_on:
- rabbitmq
networks:
- internal
- poulet_internal
#- poulet_internal

rabbitmq:
image: rabbitmq:management
Expand All @@ -48,7 +48,7 @@ services:
- 127.0.0.1:8080:15672
networks:
- internal
- poulet_internal
#- poulet_internal


agent:
Expand All @@ -67,5 +67,5 @@ services:

networks:
internal:
poulet_internal:
external: true
# poulet_internal:
# external: true

0 comments on commit 978f950

Please sign in to comment.