Trace in/out in all requests
MODIFY
src/assets/storage/schemas/performance/performance-save.json
src/assets/storage/schemas/performance/performance-save.json
"httpUrl": {
"type": "string"
},
- "httpEgress": {
+ "egress": {
"type": "boolean"
},
"httpResponseCode": {

MODIFY
src/types/Performance.ts
src/types/Performance.ts
@@ -13,7 +13,7 @@ export default interface PerformanceRecord {
resSizeKb?: number;
httpUrl?: string;
httpMethod?: string;
- httpEgress?: boolean;
+ egress?: boolean;
httpResponseCode?: number;
chargingStationID?: string;
userID?: string;

MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -103,6 +103,7 @@ export default class Logging {
durationMs: executionDurationMillis,
reqSizeKb: sizeOfRequestDataKB,
resSizeKb: sizeOfResponseDataKB,
+ egress: true,
action: `${module}.${method}`
})
);
@@ -148,6 +149,7 @@ export default class Logging {
durationMs: executionDurationMillis,
reqSizeKb: sizeOfRequestDataKB,
resSizeKb: 0,
+ egress: true,
action: `${module}.${method}.${templateName}`,
userID
})
@@ -331,7 +333,7 @@ export default class Logging {
group: Utils.getPerformanceRecordGroupFromURL(req.originalUrl),
httpUrl: req.url,
httpMethod: req.method,
- httpEgress: false,
+ egress: false,
reqSizeKb: sizeOfRequestDataKB,
action: ServerAction.HTTP_REQUEST,
})
@@ -472,7 +474,7 @@ export default class Logging {
group: Utils.getPerformanceRecordGroupFromURL(request.url),
httpUrl: request.url,
httpMethod: request.method.toLocaleUpperCase(),
- httpEgress: true,
+ egress: true,
reqSizeKb: sizeOfRequestDataKB,
action: Utils.getAxiosActionFromURL(request.url),
})
@@ -698,6 +700,7 @@ export default class Logging {
chargingStationID,
group: PerformanceRecordGroup.OCPP,
reqSizeKb: sizeOfRequestDataKB,
+ egress: direction === '<<' ? true : false,
action
})
);

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -1500,7 +1500,7 @@ export default class Utils {
public static buildPerformanceRecord(params: {
tenantSubdomain?: string; durationMs?: number; resSizeKb?: number; reqSizeKb?: number;
action: ServerAction|string; group?: PerformanceRecordGroup; httpUrl?: string;
- httpMethod?: string; httpResponseCode?: number; httpEgress?: boolean; chargingStationID?: string, userID?: string
+ httpMethod?: string; httpResponseCode?: number; egress?: boolean; chargingStationID?: string, userID?: string
}): PerformanceRecord {
const performanceRecord: PerformanceRecord = {
tenantSubdomain: params.tenantSubdomain,
@@ -1527,8 +1527,8 @@ export default class Utils {
if (params.httpMethod) {
performanceRecord.httpMethod = params.httpMethod;
}
- if (Utils.objectHasProperty(params, 'httpEgress')) {
- performanceRecord.httpEgress = params.httpEgress;
+ if (Utils.objectHasProperty(params, 'egress')) {
+ performanceRecord.egress = params.egress;
}
if (params.httpResponseCode) {
performanceRecord.httpResponseCode = params.httpResponseCode;

Trace in/out in all requests