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

New Notification: Slow Response Time w/ Resend Interval #4005

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
daacc28
Reimplement functionality from
stephenpapierski Oct 27, 2023
8669c5d
Add slow response notification resend interval to db/gui
stephenpapierski Oct 29, 2023
8fc0b6a
Add slow response notification resend interval, also notify when resp…
stephenpapierski Nov 1, 2023
c722d8b
Merge branch 'louislam:master' into feature-slow-response-notification
stephenpapierski Nov 1, 2023
fd745d1
Prevent slowResponseNotificationRange from being less than one Heartb…
stephenpapierski Nov 1, 2023
6c31994
Fix behavior of slowResponseNotificationRetryInterval
stephenpapierski Nov 1, 2023
da43e1b
Add calculation method to just use last heartbeat
stephenpapierski Nov 1, 2023
f81c48d
Round response time to nearest ms when using average
stephenpapierski Nov 1, 2023
9c5bb42
Merge branch 'louislam:master' into feature-slow-response-notification
stephenpapierski Nov 3, 2023
51e48e6
Clean up notification logic and messages
stephenpapierski Nov 7, 2023
2ff8e57
Merge branch 'louislam:master' into feature-slow-response-notification
stephenpapierski Nov 8, 2023
d73a17f
Add threshold calculations methods
stephenpapierski Nov 8, 2023
1bb1a2b
Add threshold calculations methods
stephenpapierski Nov 8, 2023
d5e6805
Merge branch 'feature-slow-response-notification' of github.com:steph…
stephenpapierski Nov 8, 2023
77dc2dd
Don't check for slow response unless monitor is UP
stephenpapierski Nov 8, 2023
d370980
Add db defaults so existing entries don't show up empty
stephenpapierski Nov 8, 2023
9dd577d
ESLint fixes
stephenpapierski Nov 9, 2023
2b7f5c5
Add threshold line to ping chart
stephenpapierski Nov 10, 2023
d9e787b
Fix threshold line autoscaling y-axis range
stephenpapierski Nov 12, 2023
6228ef1
Add `Slow` display to monitor dashboard
stephenpapierski Nov 13, 2023
abb5138
Merge branch 'master' into feature-slow-response-notification
stephenpapierski Nov 13, 2023
3b6b316
lint fix
stephenpapierski Nov 13, 2023
ecbd105
Add slow response events to details dashboard
stephenpapierski Nov 14, 2023
c503d12
Add slow response events to dashboard home
stephenpapierski Nov 14, 2023
1870b5c
Fix: Clear Events clears slow response events too
stephenpapierski Nov 14, 2023
a453e3c
Fix for important & pingImportant both true
stephenpapierski Nov 14, 2023
6c0aaaa
Add Slow to Dashboard Quick Stats
stephenpapierski Nov 14, 2023
06c22eb
Fix slow response status messages auto show up now
stephenpapierski Nov 14, 2023
cabc458
Fix "slow" quick stats calculation
stephenpapierski Nov 14, 2023
b2aa549
Add slow response toast messages
stephenpapierski Nov 14, 2023
533e531
Adjust notification messagess
stephenpapierski Nov 14, 2023
71d0bd5
Fix class typo
stephenpapierski Nov 14, 2023
1749b1c
Merge remote-tracking branch 'upstream/master' into feature-slow-resp…
stephenpapierski Nov 14, 2023
18f2056
Fixing a comment
stephenpapierski Nov 14, 2023
263eecc
lint fix
stephenpapierski Nov 15, 2023
2297645
lint fix
stephenpapierski Nov 15, 2023
20d5ded
Fix: sendHeartbeatList now sends correct format
stephenpapierski Nov 15, 2023
ee53ded
Simplify logic due to bug fix
stephenpapierski Nov 15, 2023
177f1f2
Log language clarification
stephenpapierski Nov 15, 2023
20d1970
oops, wrong numbers
stephenpapierski Nov 15, 2023
d1af449
Add `Slow`/`Nominal` to en.json
stephenpapierski Nov 16, 2023
9cfaf98
Add threshold to pingMsg
stephenpapierski Nov 16, 2023
d291b0e
Merge remote-tracking branch 'upstream/master' into feature-slow-resp…
stephenpapierski Nov 27, 2023
f1667a9
Merge branch 'louislam:master' into feature-slow-response-notification
stephenpapierski Nov 27, 2023
fc7884e
Remove commented out code
stephenpapierski Nov 27, 2023
cbea6de
Update lock file
stephenpapierski Nov 27, 2023
bdfe95a
Add support for SLOW/NOMINAL notification cards
stephenpapierski Nov 28, 2023
7d5297d
Add discord support for SLOW/NOMINAL notification cards
stephenpapierski Nov 28, 2023
19799e5
Add slack support for SLOW/NOMINAL notification cards
stephenpapierski Nov 28, 2023
e4a2f78
Move notification msg generation to send function
stephenpapierski Nov 28, 2023
763925b
lint fix
stephenpapierski Nov 28, 2023
409935c
Merge branch 'master' into feature-slow-response-notification
stephenpapierski Dec 15, 2023
029e575
Merge branch 'master' into feature-slow-response-visual-improvements
stephenpapierski Dec 15, 2023
64970ed
Merge branch 'master' into feature-slow-response-notification-cards
stephenpapierski Dec 15, 2023
2755276
Merge branch 'feature-slow-response-visual-improvements' into feature…
stephenpapierski Jan 16, 2024
e4b7913
Merge branch 'feature-slow-response-notification-cards' into feature-…
stephenpapierski Jan 16, 2024
555f09f
Merge branch 'master' into feature-slow-response-notification
stephenpapierski Jan 16, 2024
988e0c1
Add chartjs-plugin-annotation to package-lock.json
stephenpapierski Jan 16, 2024
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
33 changes: 33 additions & 0 deletions db/knex_migrations/2023-11-09-slow-response-notification.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
exports.up = function (knex) {
// add various slow_response_notification parameters
return knex.schema
.alterTable("monitor", function (table) {
table.boolean("slow_response_notification").notNullable().defaultTo(false);
table.string("slow_response_notification_method").notNullable().defaultTo("average");
table.integer("slow_response_notification_range").notNullable().defaultTo(300);
table.string("slow_response_notification_threshold_method").notNullable().defaultTo("threshold-relative-24-hour");
table.integer("slow_response_notification_threshold").notNullable().defaultTo(2500);
table.float("slow_response_notification_threshold_multiplier").notNullable().defaultTo(5.0);
table.integer("slow_response_notification_resend_interval").notNullable().defaultTo(0);
})
.alterTable("heartbeat", function (table) {
table.integer("slow_response_count").notNullable().defaultTo(0);
});
};

exports.down = function (knex) {
// remove various slow_response_notification parameters
return knex.schema
.alterTable("monitor", function (table) {
table.dropColumn("slow_response_notification");
table.dropColumn("slow_response_notification_method");
table.dropColumn("slow_response_notification_range");
table.dropColumn("slow_response_notification_threshold_method");
table.dropColumn("slow_response_notification_threshold");
table.dropColumn("slow_response_notification_threshold_multiplier");
table.dropColumn("slow_response_notification_resend_interval");
})
.alterTable("heartbeat", function (table) {
table.dropColumn("slow_response_count");
});
};
21 changes: 21 additions & 0 deletions db/knex_migrations/2023-11-10-slow-response-visual-improvements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
exports.up = function (knex) {
// add various slow response parameters
return knex.schema
.alterTable("heartbeat", function (table) {
table.integer("ping_status").nullable().defaultTo(null);
table.integer("ping_threshold").nullable().defaultTo(null);
table.boolean("ping_important").notNullable().defaultTo(0);
table.string("ping_msg").nullable().defaultTo(null);
});
};

exports.down = function (knex) {
// remove various slow response parameters
return knex.schema
.alterTable("heartbeat", function (table) {
table.dropColumn("ping_status");
table.dropColumn("ping_threshold");
table.dropColumn("ping_important");
table.dropColumn("ping_msg");
});
};
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"bootstrap": "5.1.3",
"chart.js": "~4.2.1",
"chartjs-adapter-dayjs-4": "~1.0.4",
"chartjs-plugin-annotation": "~3.0.1",
"concurrently": "^7.1.0",
"core-js": "~3.26.1",
"cronstrue": "~2.24.0",
Expand Down
2 changes: 1 addition & 1 deletion server/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function sendHeartbeatList(socket, monitorID, toUser = false, overwrite =
monitorID,
]);

let result = list.reverse();
let result = R.convertToBeans("heartbeat", list.reverse());

if (toUser) {
io.to(socket.userID).emit("heartbeatList", monitorID, result, overwrite);
Expand Down
7 changes: 7 additions & 0 deletions server/model/heartbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const { BeanModel } = require("redbean-node/dist/bean-model");
* 1 = UP
* 2 = PENDING
* 3 = MAINTENANCE
* pingStatus:
* 4 = SLOW
* 5 = NOMINAL
*/
class Heartbeat extends BeanModel {

Expand Down Expand Up @@ -37,6 +40,10 @@ class Heartbeat extends BeanModel {
important: this._important,
duration: this._duration,
retries: this._retries,
pingThreshold: this._pingThreshold,
pingStatus: this._pingStatus,
pingImportant: this._pingImportant,
pingMsg: this._pingMsg,
};
}

Expand Down
Loading
Loading