mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-21 13:47:39 +02:00
chore: bulk metrics - remove a flag (#10190)
This commit is contained in:
parent
6aecc3f93e
commit
daa6461d9b
@ -71,35 +71,6 @@ export default class ClientInstanceStore implements IClientInstanceStore {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* `bulkUpsert` is beeing used instead. remove with `lastSeenBulkQuery` flag
|
||||
*/
|
||||
async setLastSeen({
|
||||
appName,
|
||||
instanceId,
|
||||
environment,
|
||||
clientIp,
|
||||
}: INewClientInstance): Promise<void> {
|
||||
const stopTimer = this.metricTimer('setLastSeen');
|
||||
|
||||
await this.db(TABLE)
|
||||
.insert({
|
||||
app_name: appName,
|
||||
instance_id: instanceId,
|
||||
environment,
|
||||
last_seen: new Date(),
|
||||
client_ip: clientIp,
|
||||
})
|
||||
.onConflict(['app_name', 'instance_id', 'environment'])
|
||||
.merge({
|
||||
last_seen: new Date(),
|
||||
client_ip: clientIp,
|
||||
});
|
||||
|
||||
stopTimer();
|
||||
}
|
||||
|
||||
async bulkUpsert(instances: INewClientInstance[]): Promise<void> {
|
||||
const stopTimer = this.metricTimer('bulkUpsert');
|
||||
|
||||
|
@ -101,21 +101,12 @@ export default class ClientInstanceService {
|
||||
): Promise<void> {
|
||||
const value = await clientMetricsSchema.validateAsync(data);
|
||||
|
||||
if (this.flagResolver.isEnabled('lastSeenBulkQuery')) {
|
||||
this.seenClients[this.clientKey(value)] = {
|
||||
appName: value.appName,
|
||||
instanceId: value.instanceId,
|
||||
environment: value.environment,
|
||||
clientIp: clientIp,
|
||||
};
|
||||
} else {
|
||||
await this.clientInstanceStore.setLastSeen({
|
||||
appName: value.appName,
|
||||
instanceId: value.instanceId,
|
||||
environment: value.environment,
|
||||
clientIp: clientIp,
|
||||
});
|
||||
}
|
||||
this.seenClients[this.clientKey(value)] = {
|
||||
appName: value.appName,
|
||||
instanceId: value.instanceId,
|
||||
environment: value.environment,
|
||||
clientIp: clientIp,
|
||||
};
|
||||
}
|
||||
|
||||
public registerFrontendClient(data: IFrontendClientApp): void {
|
||||
|
@ -56,7 +56,6 @@ export type IFlagKey =
|
||||
| 'edgeObservability'
|
||||
| 'registerFrontendClient'
|
||||
| 'reportUnknownFlags'
|
||||
| 'lastSeenBulkQuery'
|
||||
| 'lifecycleMetrics'
|
||||
| 'customMetrics'
|
||||
| 'impactMetrics'
|
||||
@ -267,10 +266,6 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS,
|
||||
false,
|
||||
),
|
||||
lastSeenBulkQuery: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_LAST_SEEN_BULK_QUERY,
|
||||
false,
|
||||
),
|
||||
lifecycleMetrics: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_LIFECYCLE_METRICS,
|
||||
false,
|
||||
|
@ -18,11 +18,6 @@ export interface IClientInstanceStore
|
||||
Pick<INewClientInstance, 'appName' | 'instanceId'>
|
||||
> {
|
||||
bulkUpsert(instances: INewClientInstance[]): Promise<void>;
|
||||
/**
|
||||
* @deprecated
|
||||
* `bulkUpsert` is beeing used instead. remove with `lastSeenBulkQuery` flag
|
||||
*/
|
||||
setLastSeen(INewClientInstance): Promise<void>;
|
||||
insert(details: INewClientInstance): Promise<void>;
|
||||
getByAppName(appName: string): Promise<IClientInstance[]>;
|
||||
getRecentByAppNameAndEnvironment(
|
||||
|
@ -28,10 +28,6 @@ export default class FakeClientInstanceStore implements IClientInstanceStore {
|
||||
);
|
||||
}
|
||||
|
||||
setLastSeen(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
async getBySdkName(sdkName: string): Promise<IClientInstance[]> {
|
||||
return this.instances.filter((instance) =>
|
||||
instance.sdkVersion?.startsWith(sdkName),
|
||||
|
Loading…
Reference in New Issue
Block a user