-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
per-service worker monitoring infrastructure (#37)
* per-service worker monitoring infrastructure * improve worker report style, still basic
- Loading branch information
Showing
10 changed files
with
370 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE worker_metadata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE worker_metadata | ||
( | ||
id SERIAL PRIMARY KEY, | ||
service_id INTEGER NOT NULL, | ||
last_dispatched_task_id BIGINT NOT NULL, | ||
last_returned_task_id BIGINT, | ||
total_dispatched INTEGER NOT NULL DEFAULT 0, | ||
total_returned INTEGER NOT NULL DEFAULT 0, | ||
first_seen TIMESTAMP NOT NULL, | ||
session_seen TIMESTAMP, | ||
time_last_dispatch TIMESTAMP NOT NULL, | ||
time_last_return TIMESTAMP, | ||
name varchar(200) NOT NULL | ||
); | ||
create unique index worker_id_idx on worker_metadata(name, service_id); | ||
create index worker_service_idx on worker_metadata(service_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use backend; | ||
|
||
enum EventKind { | ||
Send, | ||
Receive, | ||
} | ||
|
||
pub struct Event { | ||
pub kind: EventKind, | ||
pub time: String, | ||
pub valid: bool, | ||
pub task: String, | ||
pub service: String, | ||
pub identity: String, | ||
} | ||
|
||
pub fn register_event(e: Event) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.