Add time logs to StaffLdb Transformation

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-08-07 10:39:50 +01:00
parent 5e31361880
commit a2777f1f37
1 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import { removeNewlineAndPTag } from '../../newSanitizer';
/// I do not yet have a type defined for any of the input object
export function transform(input: any): StaffLdb | null {
console.time("StaffLdb Transformation")
const data = input.GetBoardResult
let output: StaffLdb
try {
@ -18,10 +19,12 @@ export function transform(input: any): StaffLdb | null {
busServices: transformTrainServices(data?.busServices) || undefined,
ferryServices: transformTrainServices(data?.ferryServices) || undefined
}
console.timeEnd("StaffLdb Transformation")
return output
} catch (err) {
console.log('Unable to parse data, assuming no data: ' + err)
}
console.timeEnd("StaffLdb Transformation")
return null
}