npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-evidently-l2

v1.1.0

Published

This is a fork of https://github.com/aws/aws-cdk-rfcs/issues/428 implemention (https://github.com/ljuti/aws-cdk/tree/construct/aws-evidently/packages/%40aws-cdk/aws-evidently)

Downloads

468

Readme

Evidently L2

This is a fork of https://github.com/aws/aws-cdk-rfcs/issues/428 implemention (https://github.com/ljuti/aws-cdk/tree/construct/aws-evidently/packages/%40aws-cdk/aws-evidently)

Core Constructs

Project

A Project is an AWS Evidently project where you group and track features, launches and experiments.

Feature

A Feature is an AWS Evidently feature, a set of behaviour in your application that you wish to launch or test.

Launch

A Launch is an AWS Evidently launch which you use to schedule or incrementally release a feature.

Experiment

An Experiment is an AWS Evidently experiment that helps you make feature design decisions based on evidence and data.

API Walkthrough with a Use Case Example

In an AWS News Blog article, author @sebsto demonstrates how to use AWS Evidently with a web application example.

Let's see how we would use the construct library to replace AWS Console tasks of the example.

  1. Create a Project
    import * as evidently from 'aws-cdk-lib/aws_evidently';
    
    const project = new evidently.Project(this, 'GuestbookWebApp', {
    projectName: 'AWSNewsBlog',
    description: 'AWSNewsBlogDemo',
    });
  2. Add a Feature
    const editable = new evidently.Variation({
    variationName: 'editable',
    valueType: VariationObjectValueType.BOOLEAN,
    value: true,
    });
           
    const readonly = new evidently.Variation({
    variationName: 'readonly',
    valueType: VariationObjectValueType.BOOLEAN,
    value: false,
    });
    
    const feature = new evidently.Feature(this, 'EditableGuestbook', {
    project: project,
    featureName: 'Editing',
    variations: [
        editable,
        readonly,
    ],
    entityOverrides: [
        new EntityOverride({
        entityId: 'seb',
        variation: editable,
        });
    ],
    });
  3. Create a Launch
    const editableGroup = new evidently.LaunchGroup({
    groupName: 'Editable',
    feature: feature,
    variation: editable,
    });
    const readonlyGroup = new evidently.LaunchGroup({
    groupName: 'Readonly',
    feature: feature,
    variation: readonly,
    });
    
    const launchConfiguration = new StepConfig({
    groupsToWeight: [
        {
        group: editableGroup,
        splitWeight: SplitWeight.50_PCT,
        }
    ],
    startTime: <timestamp>,
    });
    
    const launch = new evidently.Launch(this, 'EditableGuestbook', {
    launchName: 'EditableGuestbook',
    description: 'Launch the editable guest book feature',
    groups: [
        editableGroup,
        readonlyGroup,
    ],
    scheduledSplitsConfig: [launchConfiguration],
    });
  4. Start an Experiment
    const goal = new evidently.MetricGoal({
    desiredChange: MetricGoalDesiredChange.INCREASE,
    entityIdKey: 'user',
    eventPattern: 'eventbridge-pattern',
    metricName: 'Edits',
    valueKey: 'edits',
    });
    
    const treatmentOne = new evidently.Treatment({
    feature: feature,
    treatmentName: 'editing',
    variation: editable,
    });
    
    const treatmentTwo = new evidently.Treatment({
    feature: feature,
    treatmentName: 'readonly',
    variation: readonly,
    });
    
    const config = new evidently.OnlineAbConfig({
    controlTreatmentName: treatmentOne.treatmentName,
    treatmentWeights: [
        new evidently.TreatmentToWeight({
        splitWeight: 20000,
        treatment: treatmentOne,
        }),
        new evidently.TreatmentToWeight({
        splitWeight: 80000,
        treatment: treatmentTwo,
        }),
    ],
    });
    
    const experiment = new evidently.Experiment({
    project: project,
    experimentName: 'EditableGuestBook',
    metricGoals: [goal],
    onlineAbConfig: config,
    treatments: [
        treatmentOne,
        treatmentTwo,
    ],
    });

More

  • If using feature flags in a web app, I strongly recommend looking at @sebsto example to deal with unauthenticated role and cognito ;)
  • DOn't forget to grant permissions to your role used to be able to leverage aws-sdk V3 and BatchEvaluateFeatureCommand and EvaluateFeatureCommand to get the feature flags values. For instance in your cdk code :
    this.unauthenticatedRole.attachInlinePolicy(
    		new Policy(this, "EvidentlyPolicy", {
    			statements: [
    				new PolicyStatement({
    					actions: [
    						"evidently:EvaluateFeature",
    						"evidently:BatchEvaluateFeature",
    					],
    					resources: [
    						`arn:aws:evidently:${Stack.of(this).region}:${Stack.of(this).account}:project/${this.featureFlagStore.project.projectName}/feature/*`,
    					],
    					effect: Effect.ALLOW,
    				}),
    			],
    		})
    	);
        ```
    

Credits

@ljuti