This repository has been archived by the owner on Dec 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Schramm
committed
Jun 1, 2020
1 parent
288fed2
commit 5f320f6
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Injectable, OnApplicationBootstrap } from '@nestjs/common'; | ||
import MatomoTracker from 'matomo-tracker'; | ||
import { PinoLogger } from 'nestjs-pino/dist'; | ||
|
||
@Injectable() | ||
export class InstallationMetricsService implements OnApplicationBootstrap { | ||
private host = 'https://metrics.ohmyform.com/matomo.php' | ||
|
||
constructor( | ||
private readonly logger: PinoLogger, | ||
) { | ||
} | ||
|
||
async onApplicationBootstrap(): Promise<void> { | ||
const tracker = new MatomoTracker(1, this.host) | ||
|
||
tracker.on('error', () => { | ||
this.logger.error('failed to register instance') | ||
}) | ||
|
||
tracker.track({ | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
action_name: 'startup', | ||
ua: process.arch | ||
}) | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters