Merge pull request #1697 from bluewave-labs/feat/be/additional-du-monitor-fields
feat: add additionalfields
This commit is contained in:
3 files changed
+58
-3
No files matched your search
@@ -54,8 +54,13 @@ class DistributedUptimeController {
|
|||||||
status,
|
status,
|
||||||
code: status_code,
|
code: status_code,
|
||||||
responseTime,
|
responseTime,
|
||||||
|
first_byte_took,
|
||||||
|
body_read_took,
|
||||||
|
dns_took,
|
||||||
|
conn_took,
|
||||||
|
connect_took,
|
||||||
|
tls_took,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
const code = status_code || this.NETWORK_ERROR;
|
const code = status_code || this.NETWORK_ERROR;
|
||||||
distributedUptimeResponse.code = code;
|
distributedUptimeResponse.code = code;
|
||||||
|
|||||||
@@ -61,6 +61,30 @@ const LocationSchema = new mongoose.Schema(
|
|||||||
const DistributedUptimeCheckSchema = mongoose.Schema(
|
const DistributedUptimeCheckSchema = mongoose.Schema(
|
||||||
{
|
{
|
||||||
...BaseCheckSchema.obj,
|
...BaseCheckSchema.obj,
|
||||||
|
first_byte_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
body_read_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
dns_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
conn_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
connect_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
tls_took: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
location: {
|
location: {
|
||||||
type: LocationSchema,
|
type: LocationSchema,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -83,8 +83,22 @@ class StatusService {
|
|||||||
* @returns {Object} The check object.
|
* @returns {Object} The check object.
|
||||||
*/
|
*/
|
||||||
buildCheck = (networkResponse) => {
|
buildCheck = (networkResponse) => {
|
||||||
const { monitorId, teamId, type, status, responseTime, code, message, payload } =
|
const {
|
||||||
networkResponse;
|
monitorId,
|
||||||
|
teamId,
|
||||||
|
type,
|
||||||
|
status,
|
||||||
|
responseTime,
|
||||||
|
code,
|
||||||
|
message,
|
||||||
|
payload,
|
||||||
|
first_byte_took,
|
||||||
|
body_read_took,
|
||||||
|
dns_took,
|
||||||
|
conn_took,
|
||||||
|
connect_took,
|
||||||
|
tls_took,
|
||||||
|
} = networkResponse;
|
||||||
|
|
||||||
const check = {
|
const check = {
|
||||||
monitorId,
|
monitorId,
|
||||||
@@ -93,6 +107,12 @@ class StatusService {
|
|||||||
statusCode: code,
|
statusCode: code,
|
||||||
responseTime,
|
responseTime,
|
||||||
message,
|
message,
|
||||||
|
first_byte_took,
|
||||||
|
body_read_took,
|
||||||
|
dns_took,
|
||||||
|
conn_took,
|
||||||
|
connect_took,
|
||||||
|
tls_took,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type === "distributed_http") {
|
if (type === "distributed_http") {
|
||||||
@@ -101,6 +121,12 @@ class StatusService {
|
|||||||
check.city = payload.city;
|
check.city = payload.city;
|
||||||
check.location = payload.location;
|
check.location = payload.location;
|
||||||
check.uptBurnt = payload.upt_burnt;
|
check.uptBurnt = payload.upt_burnt;
|
||||||
|
check.first_byte_took = payload.first_byte_took;
|
||||||
|
check.body_read_took = payload.body_read_took;
|
||||||
|
check.dns_took = payload.dns_took;
|
||||||
|
check.conn_took = payload.conn_took;
|
||||||
|
check.connect_took = payload.connect_took;
|
||||||
|
check.tls_took = payload.tls_took;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === "pagespeed") {
|
if (type === "pagespeed") {
|
||||||
|
|||||||
Reference in new issue
Block a user