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

View File

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