Skip to content

Commit eb8c181

Browse files
feat: update offline probe fields values
1 parent d71d0b2 commit eb8c181

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Diff for: src/probe/router.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Location } from '../lib/location/types.js';
55
import type { Probe } from './types.js';
66
import { ProbesLocationFilter } from './probes-location-filter.js';
77
import { getMeasurementStore } from '../measurement/store.js';
8+
import { normalizeFromPublicName, normalizeNetworkName } from '../lib/geoip/utils.js';
89

910
export class ProbeRouter {
1011
private readonly probesFilter = new ProbesLocationFilter();
@@ -110,17 +111,17 @@ export class ProbeRouter {
110111
region: prevTest.probe.region,
111112
country: prevTest.probe.country,
112113
city: prevTest.probe.city,
113-
normalizedCity: prevTest.probe.city.toLowerCase(),
114+
normalizedCity: normalizeFromPublicName(prevTest.probe.city),
114115
asn: prevTest.probe.asn,
115116
latitude: prevTest.probe.latitude,
116117
longitude: prevTest.probe.longitude,
117-
state: prevTest.probe.state ?? undefined,
118+
state: prevTest.probe.state,
118119
network: prevTest.probe.network,
119-
normalizedNetwork: prevTest.probe.network.toLowerCase(),
120+
normalizedNetwork: normalizeNetworkName(prevTest.probe.network),
120121
},
121122
index: [],
122123
resolvers: prevTest.probe.resolvers,
123-
tags: prevTest.probe.tags.map(tag => ({ value: tag, type: 'system' })),
124+
tags: prevTest.probe.tags.map(tag => ({ value: tag, type: 'offline' })),
124125
stats: {
125126
cpu: {
126127
count: 0,

Diff for: src/probe/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type ProbeStats = {
2626
};
2727

2828
export type Tag = {
29-
type: 'system' | 'admin' | 'user';
29+
type: 'system' | 'admin' | 'user' | 'offline';
3030
value: string;
3131
};
3232

0 commit comments

Comments
 (0)