Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add configuration overrides and metrics data kinds. #220

Merged
merged 7 commits into from
Aug 3, 2023

Conversation

kinyoklion
Copy link
Member

No description provided.

@@ -164,32 +174,24 @@ describe('given a stream processor with mock event source', () => {
});

describe('when patching a message', () => {
it('updates a patched flag', async () => {
it.each([
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored these tests a little to simplify things.

@@ -151,11 +151,13 @@ const segmentWithBucketBy = {
deleted: false,
};

function makeAllData(flag?: any, segment?: any): any {
function makeAllData(flag?: any, segment?: any, override?: any, metric?: any): any {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern was ported from the old implementation. I don't really care for it, so maybe it is in for a change in the future.

import { Versioned } from '../evaluation/data/Versioned';

export interface Metric extends Versioned {
samplingRatio: number;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I have this required, but is it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is, but also currently this type specifically configured a sampling ratio, as it contains nothing else.

So the sampling ratio for a normal track event will be 1. If LD wants to change it from 1, then it will include one of these metric objects with a new value.

The question is really, if LD provides a metric, will it always have a samplingRatio. Or could we add other fields and then exclude this one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout other specs, we have worked on the premise that if it isn't set, it will default to 1. Seems silly here but maybe worth doing just to future proof and stay consistent?

@@ -23,13 +25,15 @@ export function reviver(this: any, key: string, value: any): any {
return value;
}

interface FlagsAndSegments {
interface AllData {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names are internal, so I changed them to be less confusing. Should not hurt anything.

@kinyoklion kinyoklion marked this pull request as ready for review August 2, 2023 16:48
import { Versioned } from '../evaluation/data/Versioned';

export interface Metric extends Versioned {
samplingRatio: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throughout other specs, we have worked on the premise that if it isn't set, it will default to 1. Seems silly here but maybe worth doing just to future proof and stay consistent?

@kinyoklion kinyoklion merged commit ababe74 into feat/node-migrations Aug 3, 2023
13 checks passed
@kinyoklion kinyoklion deleted the rlamb/new-data-kinds branch August 3, 2023 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants