-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
@@ -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([ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a default?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
import { Versioned } from '../evaluation/data/Versioned'; | ||
|
||
export interface Metric extends Versioned { | ||
samplingRatio: number; |
There was a problem hiding this comment.
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?
…ver-sdk-private into rlamb/new-data-kinds
No description provided.