Skip to content

Commit 38ff425

Browse files
committed
Collect metrics about .car files from RPA
1 parent 566230e commit 38ff425

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterEnum
2+
ALTER TYPE "StorageProviderUrlFinderMetricType" ADD VALUE 'CAR_FILES';

prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ enum StorageProviderUrlFinderMetricType {
566566
TTFB
567567
RPA_RETRIEVABILITY
568568
BANDWIDTH
569+
CAR_FILES
569570
}
570571

571572
enum StorageProviderUrlFinderMetricResultCodeType {

src/jobs/storage-provider-ulr-finder-snapshot-job/storage-provider-url-finder-shanpshot-job.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export class StorageProviderUrlFinderSnapshotMetricService extends HealthIndicat
101101
const {
102102
provider_id,
103103
retrievability_percent,
104+
car_files_percent,
104105
tested_at,
105106
performance,
106107
diagnostics,
@@ -111,7 +112,6 @@ export class StorageProviderUrlFinderSnapshotMetricService extends HealthIndicat
111112
new Date(tested_at),
112113
);
113114

114-
// keep always RPA retreavability
115115
const metrics: StorageProviderUrlFinderMetricValue[] = [
116116
{
117117
metricType:
@@ -122,6 +122,12 @@ export class StorageProviderUrlFinderSnapshotMetricService extends HealthIndicat
122122
: null,
123123
testedAt: new Date(tested_at),
124124
},
125+
{
126+
metricType: StorageProviderUrlFinderMetricType.CAR_FILES,
127+
value:
128+
car_files_percent != null ? car_files_percent / 100 : null,
129+
testedAt: new Date(tested_at),
130+
},
125131

126132
performance?.bandwidth?.ttfb_ms &&
127133
isPerformanceTestInLastTestDay // only if test was done same day as retrievability test

src/service/storage-provider-url-finder/storage-provider-url-finder.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ export class StorageProviderUrlFinderService {
209209
[StorageProviderUrlFinderMetricType.RPA_RETRIEVABILITY]:
210210
'RPA Retrievability',
211211
[StorageProviderUrlFinderMetricType.BANDWIDTH]: 'Bandwith',
212+
[StorageProviderUrlFinderMetricType.CAR_FILES]:
213+
'CAR files Retrievability',
212214
};
213215

214216
return METRIC_NAME[storageProviderMetric];
@@ -226,6 +228,8 @@ export class StorageProviderUrlFinderService {
226228
'RPA Retrievability percentage',
227229
[StorageProviderUrlFinderMetricType.BANDWIDTH]:
228230
'Download bandwidth in Mbps',
231+
[StorageProviderUrlFinderMetricType.CAR_FILES]:
232+
'CAR files retrievability percentage',
229233
};
230234

231235
return METRIC_DESCRIPTION[storageProviderMetric];
@@ -241,6 +245,7 @@ export class StorageProviderUrlFinderService {
241245
[StorageProviderUrlFinderMetricType.TTFB]: 'ms',
242246
[StorageProviderUrlFinderMetricType.RPA_RETRIEVABILITY]: '%',
243247
[StorageProviderUrlFinderMetricType.BANDWIDTH]: 'Mbps',
248+
[StorageProviderUrlFinderMetricType.CAR_FILES]: '%',
244249
};
245250

246251
return METRIC_UNIT[storageProviderMetric];

src/service/storage-provider-url-finder/types.storage-provider-url-finder.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface UrlFinderStorageProviderData {
4242
client_id: string | null;
4343
working_url: string | null;
4444
retrievability_percent: number;
45+
car_files_percent: number | null;
4546
tested_at: string;
4647
performance: UrlFinderStorageProviderPerformanceData;
4748
}

0 commit comments

Comments
 (0)