Skip to content

Commit

Permalink
Merge branch 'main' into testpr
Browse files Browse the repository at this point in the history
  • Loading branch information
r59q authored May 10, 2024
2 parents 96ad7d3 + 64101a0 commit 43c1c67
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const load = () => {
appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
}
};
const appInsights = new ApplicationInsights({
export const appInsights = new ApplicationInsights({
config: {
connectionString:
'InstrumentationKey=9ff70ae9-1397-4b70-85f2-2d3e80a29113;IngestionEndpoint=https://northeurope-2.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/',
Expand Down
14 changes: 13 additions & 1 deletion src/pages/training/TrainingPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import StaticConfiguration from '../../StaticConfiguration';
import CookieManager from '../../script/CookieManager';
import { stores } from '../../script/stores/Stores';
import { appInsights } from '../../appInsights';
const classifier = stores.getClassifier();
const gestures = stores.getGestures();
Expand All @@ -46,6 +47,17 @@
return newLoss;
});
};
const trackModelEvent = () => {
if (CookieManager.getComplianceChoices().analytics) {
appInsights.trackEvent({
name: 'ModelTrained',
properties: {
modelType: $selectedModelOption.id,
},
});
}
};
</script>

<TrainingFailedDialog />
Expand Down Expand Up @@ -89,7 +101,7 @@
<div class="w-full pt-5 text-white pb-5">
<TrainModelButton
selectedOption={selectedModelOption}
onClick={resetLoss}
onClick={() => {resetLoss(); trackModelEvent();}}
onTrainingIteration={trainingIterationHandler} />
</div>
{/if}
Expand Down

0 comments on commit 43c1c67

Please sign in to comment.