Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add performance - p75 support

Blue Mousebc9f41ff72ef
diff --git a/backend/apps/cloud/src/analytics/analytics.service.ts b/backend/apps/cloud/src/analytics/analytics.service.ts
index faca81777..7e092bfb8 100644
--- a/backend/apps/cloud/src/analytics/analytics.service.ts
+++ b/backend/apps/cloud/src/analytics/analytics.service.ts
@@ -125,6 +125,7 @@ const MEASURES_MAP = {
average: 'avg',
median: 'median',
p95: 'quantileExact(0.95)',
+ p75: 'quantileExact(0.75)',
}
// mapping of allowed timebuckets per difference between days
@@ -4287,7 +4288,7 @@ export class AnalyticsService {
}
checkIfPerfMeasureIsValid(measure: PerfMeasure) {
- const validMeasures = ['average', 'median', 'p95', 'quantiles']
+ const validMeasures = ['average', 'median', 'p95', 'p75', 'quantiles']
if (!_includes(validMeasures, measure)) {
throw new UnprocessableEntityException(
diff --git a/backend/apps/cloud/src/analytics/interfaces/index.ts b/backend/apps/cloud/src/analytics/interfaces/index.ts
index b097687df..5feab4fb4 100644
--- a/backend/apps/cloud/src/analytics/interfaces/index.ts
+++ b/backend/apps/cloud/src/analytics/interfaces/index.ts
@@ -200,4 +200,4 @@ export interface ICustomEvent {
[key: string]: number
}
-export type PerfMeasure = 'average' | 'median' | 'p95' | 'quantiles'
+export type PerfMeasure = 'average' | 'median' | 'p95' | 'p75' | 'quantiles'
diff --git a/backend/apps/community/src/analytics/analytics.service.ts b/backend/apps/community/src/analytics/analytics.service.ts
index 9da600c66..454936fdf 100644
--- a/backend/apps/community/src/analytics/analytics.service.ts
+++ b/backend/apps/community/src/analytics/analytics.service.ts
@@ -117,6 +117,7 @@ const MEASURES_MAP = {
average: 'avg',
median: 'median',
p95: 'quantileExact(0.95)',
+ p75: 'quantileExact(0.75)',
}
// mapping of allowed timebuckets per difference between days
@@ -3972,7 +3973,7 @@ export class AnalyticsService {
}
checkIfPerfMeasureIsValid(measure: PerfMeasure) {
- const validMeasures = ['average', 'median', 'p95', 'quantiles']
+ const validMeasures = ['average', 'median', 'p95', 'p75', 'quantiles']
if (!_includes(validMeasures, measure)) {
throw new UnprocessableEntityException(
diff --git a/backend/apps/community/src/analytics/interfaces/index.ts b/backend/apps/community/src/analytics/interfaces/index.ts
index d461f813c..cfd8052f6 100644
--- a/backend/apps/community/src/analytics/interfaces/index.ts
+++ b/backend/apps/community/src/analytics/interfaces/index.ts
@@ -186,4 +186,4 @@ export interface ICustomEvent {
[key: string]: number
}
-export type PerfMeasure = 'average' | 'median' | 'p95' | 'quantiles'
+export type PerfMeasure = 'average' | 'median' | 'p95' | 'p75' | 'quantiles'
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsx
index dc037cf27..639eb02d2 100644
--- a/web/app/pages/Project/View/ViewProject.helpers.tsx
+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx
@@ -243,6 +243,7 @@ const CHART_MEASURES_MAPPING_PERF = {
average: 'average',
median: 'median',
p95: 'p95',
+ p75: 'p75',
// Independent measure that provides it's own metrics
quantiles: 'quantiles',
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 0977b8eb9..f5c32b77d 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -992,9 +992,14 @@ const ViewProjectContent = () => {
const chartMeasuresPerf = useMemo(() => {
return [
{
- id: CHART_MEASURES_MAPPING_PERF.average,
- label: t('dashboard.average'),
- active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.average,
+ id: CHART_MEASURES_MAPPING_PERF.p95,
+ label: t('dashboard.xPercentile', { x: 95 }),
+ active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.p95,
+ },
+ {
+ id: CHART_MEASURES_MAPPING_PERF.p75,
+ label: t('dashboard.xPercentile', { x: 75 }),
+ active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.p75,
},
{
id: CHART_MEASURES_MAPPING_PERF.median,
@@ -1002,9 +1007,9 @@ const ViewProjectContent = () => {
active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.median,
},
{
- id: CHART_MEASURES_MAPPING_PERF.p95,
- label: t('dashboard.xPercentile', { x: 95 }),
- active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.p95,
+ id: CHART_MEASURES_MAPPING_PERF.average,
+ label: t('dashboard.average'),
+ active: activePerfMeasure === CHART_MEASURES_MAPPING_PERF.average,
},
]
}, [t, activePerfMeasure])