Commit 051a9cc2 authored by Naman Dixit's avatar Naman Dixit

Added timestamps in inter-module and intra-RS messages

parent 07911094
...@@ -23,6 +23,7 @@ The Dispatch Manager (DM) sends a request to the Resource Manager (RM), detailin ...@@ -23,6 +23,7 @@ The Dispatch Manager (DM) sends a request to the Resource Manager (RM), detailin
```javascript ```javascript
{ {
"resource_id": "unique-transaction-id", "resource_id": "unique-transaction-id",
"timestamp" : "iso-8601-timestamp",
"memory": 1024, // in MiB "memory": 1024, // in MiB
... // Any other resources ... // Any other resources
} }
...@@ -33,6 +34,7 @@ Format: ...@@ -33,6 +34,7 @@ Format:
```javascript ```javascript
{ {
"resource_id": "unique-transaction-id", "resource_id": "unique-transaction-id",
"timestamp" : "iso-8601-timestamp",
// "port": 2343 --- NOT IMPLEMENTED YET // "port": 2343 --- NOT IMPLEMENTED YET
"grunts": ["a", "b", ...] // List of machine IDs "grunts": ["a", "b", ...] // List of machine IDs
} }
...@@ -41,9 +43,10 @@ Format: ...@@ -41,9 +43,10 @@ Format:
Once the runtime entity has been launched (or the launch has failed), the Executor sends back a status message on the `LOG_COMMON` topic. Once the runtime entity has been launched (or the launch has failed), the Executor sends back a status message on the `LOG_COMMON` topic.
```javascript ```javascript
{ {
"node_id" "node_id" : "uique-machine-id",
"resource_id" "resource_id": "logical-entity-id",
"function_id" "function_id": "unique-function-id",
"timestamp" : "iso-8601-timestamp",
"reason": "deployment"/"termination" "reason": "deployment"/"termination"
"status": true/false // Only valid if reason==deployment "status": true/false // Only valid if reason==deployment
} }
...@@ -53,25 +56,28 @@ Instrumentation data is also sent on the `LOG_COMMON` topic. This data is sent f ...@@ -53,25 +56,28 @@ Instrumentation data is also sent on the `LOG_COMMON` topic. This data is sent f
and whoever needs the data is allowed to read it. Each message is required to have atleast three fields: `node_id`, `resource_id` and `function_id`. and whoever needs the data is allowed to read it. Each message is required to have atleast three fields: `node_id`, `resource_id` and `function_id`.
```javascript ```javascript
{ // Example message from Executor { // Example message from Executor
"node_id" "node_id" : "uique-machine-id",
"resource_id" "resource_id": "logical-entity-id",
"function_id" "function_id": "unique-function-id",
"cpu" "timestamp" : "iso-8601-timestamp",
"memory" "cpu" : 343, // in MHz
"network" "memory": 534, // in MiB
"network": 234 // in KBps
} }
{ // Example message from reverse proxy { // Example message from reverse proxy
"node_id" "node_id" : "uique-machine-id",
"resource_id" "resource_id": "logical-entity-id",
"function_id" "function_id": "unique-function-id",
"average_fn_time" "timestamp" : "iso-8601-timestamp",
"average_fn_time" : 23 // in ms
} }
{ // Example message from dispatch manager { // Example message from dispatch manager
"node_id" "node_id" : "uique-machine-id",
"resource_id" "resource_id": "logical-entity-id",
"function_id" "function_id": "unique-function-id",
"timestamp" : "iso-8601-timestamp",
"coldstart_time" "coldstart_time"
} }
``` ```
...@@ -206,6 +212,7 @@ Upon being launched, each Resource Daemon (RD) sends a JOIN message to the RM on ...@@ -206,6 +212,7 @@ Upon being launched, each Resource Daemon (RD) sends a JOIN message to the RM on
```javascript ```javascript
{ {
"node_id": "unique-machine-id", "node_id": "unique-machine-id",
"timestamp" : "iso-8601-timestamp"
} }
``` ```
...@@ -215,16 +222,30 @@ resources being tracked by RDs on each machine. This data is cached by the RM. ...@@ -215,16 +222,30 @@ resources being tracked by RDs on each machine. This data is cached by the RM.
```javascript ```javascript
{ {
"node_id": "unique-machine-id", "node_id": "unique-machine-id",
"timestamp" : "iso-8601-timestamp",
"memory": 1024, // in MiB "memory": 1024, // in MiB
... // Any other resources ... // Any other resources
} }
``` ```
If the RM recieves a heartbeat from an RD which has not joined before (due to either the RM dying and some older messages being stuck in Kafka),
it sends a rejoin command to the RD on topic `REJOIN_RM_2_RD`.
```javascript
{
"node_id": "unique-machine-id",
"timestamp" : "iso-8601-timestamp"
}
```
Also, if the RM doesn't recieve heartbeats from some RD for some amount of time, it assumes that the RD is dead and frees its resources.
If the RD sends a beat after this, the rejoin message is sent.
The RM, upon recieving the request from the DM, checks its local cache to find a suitable machine. If it finds some, it sends a message back to the The RM, upon recieving the request from the DM, checks its local cache to find a suitable machine. If it finds some, it sends a message back to the
DM on topic `RESPONSE_RM_2_DM`. DM on topic `RESPONSE_RM_2_DM`.
```javascript ```javascript
{ {
"resource_id": "unique-transaction-id", "resource_id": "unique-transaction-id",
"timestamp" : "iso-8601-timestamp",
// "port": 2343 --- NOT IMPLEMENTED YET // "port": 2343 --- NOT IMPLEMENTED YET
"nodes": ["a", "b", ...] // List of unique machine IDs "nodes": ["a", "b", ...] // List of unique machine IDs
} }
...@@ -236,6 +257,7 @@ Format: ...@@ -236,6 +257,7 @@ Format:
```javascript ```javascript
{ {
"resource_id": "unique-transaction-id", "resource_id": "unique-transaction-id",
"timestamp" : "iso-8601-timestamp",
"memory": 1024, // in MiB "memory": 1024, // in MiB
... // Any other resources ... // Any other resources
} }
...@@ -246,6 +268,7 @@ The RDs recieve this message and send back whether on not they satisfy the const ...@@ -246,6 +268,7 @@ The RDs recieve this message and send back whether on not they satisfy the const
{ {
"node_id": "unique-machine-id", "node_id": "unique-machine-id",
"resource_id": "unique-transaction-id", "resource_id": "unique-transaction-id",
"timestamp" : "iso-8601-timestamp",
"success" : 0/1 // 0 = fail, 1 = success "success" : 0/1 // 0 = fail, 1 = success
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment