Added egress flag in HTTP traces
MODIFY
src/assets/storage/schemas/performance/performance-save.json
src/assets/storage/schemas/performance/performance-save.json
"httpUrl": {
"type": "string"
},
+ "httpEgress": {
+ "type": "boolean"
+ },
"httpResponseCode": {
"type": "number"
}

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

MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -331,6 +331,7 @@ export default class Logging {
group: Utils.getPerformanceRecordGroupFromURL(req.originalUrl),
httpUrl: req.url,
httpMethod: req.method,
+ httpEgress: false,
reqSizeKb: sizeOfRequestDataKB,
action: ServerAction.HTTP_REQUEST,
})
@@ -471,6 +472,7 @@ export default class Logging {
group: Utils.getPerformanceRecordGroupFromURL(request.url),
httpUrl: request.url,
httpMethod: request.method.toLocaleUpperCase(),
+ httpEgress: true,
reqSizeKb: sizeOfRequestDataKB,
action: Utils.getAxiosActionFromURL(request.url),
})

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; chargingStationID?: string, userID?: string
+ httpMethod?: string; httpResponseCode?: number; httpEgress?: boolean; chargingStationID?: string, userID?: string
}): PerformanceRecord {
const performanceRecord: PerformanceRecord = {
tenantSubdomain: params.tenantSubdomain,
@@ -1527,6 +1527,9 @@ export default class Utils {
if (params.httpMethod) {
performanceRecord.httpMethod = params.httpMethod;
}
+ if (Utils.objectHasProperty(params, 'httpEgress')) {
+ performanceRecord.httpEgress = params.httpEgress;
+ }
if (params.httpResponseCode) {
performanceRecord.httpResponseCode = params.httpResponseCode;
}

Added egress flag in HTTP traces