Compare commits

...

4 Commits

Author SHA1 Message Date
standardci
8a0fbb28b0 chore(release): publish new version
- @standardnotes/analytics@2.17.4
2022-12-20 12:48:03 +00:00
Karol Sójko
618d8d5b1a tmp(analytics): add console logs for html generation on the report 2022-12-20 13:44:22 +01:00
standardci
3a936dc9c1 chore(release): publish new version
- @standardnotes/analytics@2.17.3
2022-12-20 12:15:31 +00:00
Karol Sójko
031fcd75ee fix(analytics): add debug logs for the report 2022-12-20 13:13:14 +01:00
4 changed files with 22 additions and 1 deletions

View File

@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.17.4](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.17.3...@standardnotes/analytics@2.17.4) (2022-12-20)
**Note:** Version bump only for package @standardnotes/analytics
## [2.17.3](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.17.2...@standardnotes/analytics@2.17.3) (2022-12-20)
### Bug Fixes
* **analytics:** add debug logs for the report ([031fcd7](https://github.com/standardnotes/server/commit/031fcd75eecdcf4c2f17257754a0ba3f24ba6d6e))
## [2.17.2](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.17.1...@standardnotes/analytics@2.17.2) (2022-12-20)
### Bug Fixes

View File

@@ -29,6 +29,7 @@ const requestReport = async (
calculateMonthlyRecurringRevenue: CalculateMonthlyRecurringRevenue,
timer: TimerInterface,
adminEmails: string[],
logger: Logger,
): Promise<void> => {
await calculateMonthlyRecurringRevenue.execute({})
@@ -133,6 +134,7 @@ const requestReport = async (
counts: await statisticsStore.calculateTotalCountOverPeriod(statisticName, Period.Last30DaysIncludingToday),
})
}
logger.info('Calculated thirty days statistics: %O', statisticsOverTime)
const monthlyStatisticsNames = [StatisticMeasureName.NAMES.MRR]
for (const statisticName of monthlyStatisticsNames) {
@@ -282,6 +284,7 @@ void container.load().then((container) => {
calculateMonthlyRecurringRevenue,
timer,
adminEmails,
logger,
),
)
.then(() => {

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.17.2",
"version": "2.17.4",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -9,13 +9,21 @@ const countActiveUsers = (measureName: string, data: any): { yesterday: number;
const totalActiveUsersLast30DaysIncludingToday = data.statisticMeasures.find(
(a: { name: string; period: number }) => a.name === measureName && a.period === 27,
)
// eslint-disable-next-line no-console
console.log(totalActiveUsersLast30DaysIncludingToday)
const totalActiveUsersYesterday =
totalActiveUsersLast30DaysIncludingToday.counts[totalActiveUsersLast30DaysIncludingToday.counts.length - 2]
.totalCount
// eslint-disable-next-line no-console
console.log(totalActiveUsersYesterday)
const filteredCounts = totalActiveUsersLast30DaysIncludingToday.counts.filter(
(count: { totalCount: number }) => count.totalCount !== 0,
)
// eslint-disable-next-line no-console
console.log(filteredCounts)
const averageActiveUsersLast30Days = Math.floor(
filteredCounts.reduce((previousValue: { totalCount: any }, currentValue: { totalCount: any }) => {
return previousValue.totalCount + currentValue.totalCount