Skip to content

Commit

Permalink
Let's benchmark deeper
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Sep 16, 2024
1 parent c65bed2 commit 942dac4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function initClient({ instance, accessToken }) {
// Get the instance information
// The config is needed for composing
export async function initInstance(client, instance) {
__BENCHMARK.start('init-instance');
console.log('INIT INSTANCE', client, instance);
const { masto, accessToken } = client;
// Request v2, fallback to v1 if fail
Expand Down Expand Up @@ -111,6 +112,7 @@ export async function initInstance(client, instance) {
// masto.ws = streamClient;
console.log('🎏 Streaming API client:', client);
}
__BENCHMARK.end('init-instance');
}

// Get the account information and store it
Expand All @@ -131,6 +133,7 @@ export async function initAccount(client, instance, accessToken, vapidKey) {

// Get preferences
export async function initPreferences(client) {
__BENCHMARK.start('init-preferences');
try {
const { masto } = client;
const preferences = await masto.v1.preferences.fetch();
Expand All @@ -139,6 +142,7 @@ export async function initPreferences(client) {
// silently fail
console.error(e);
}
__BENCHMARK.end('init-preferences');
}

// Get the masto instance
Expand Down

0 comments on commit 942dac4

Please sign in to comment.