Skip to content

Commit 2d2fc79

Browse files
committed
Performance logs.
1 parent fc6b2dd commit 2d2fc79

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/routes/org/[orgid]/+layout.server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export async function load({ params, locals }) {
88
const { data: userRecord } = await supabase.auth.getUser();
99
const user = userRecord ? userRecord.user : null;
1010

11+
console.log(Date.now(), 'Loading org layout', params.orgid);
12+
1113
// Find the org corresponding to the orgid or the path string
1214
let { data: org } = isValidUUID(params.orgid)
1315
? await supabase.from('orgs').select('*').eq('id', params.orgid).single()
@@ -20,6 +22,8 @@ export async function load({ params, locals }) {
2022
});
2123
}
2224

25+
console.log(Date.now(), 'Loading org data');
26+
2327
const profileQuery = supabase
2428
.from('profiles')
2529
.select('*')
@@ -74,6 +78,8 @@ export async function load({ params, locals }) {
7478
processesQuery
7579
]);
7680

81+
console.log(Date.now(), 'Returning org data');
82+
7783
return {
7884
org,
7985
uid: user ? user.id : null,

src/routes/org/[orgid]/change/[changeid]/+page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import Organization from '$database/Organization.js';
22
import { error } from '@sveltejs/kit';
33

44
export async function load({ parent, params }) {
5+
console.log(Date.now(), 'Awaiting change parent data.');
6+
57
const { supabase, org } = await parent();
68

9+
console.log(Date.now(), 'Loading change data');
10+
711
const [
812
{ data: change, error: changeError },
913
{ data: roles },
@@ -21,6 +25,8 @@ export async function load({ parent, params }) {
2125
message: 'Unable to retrieve this change.' + changeError?.message || ''
2226
});
2327

28+
console.log(Date.now(), 'Returning change data');
29+
2430
return {
2531
change,
2632
roles,

0 commit comments

Comments
 (0)