Git Product home page Git Product logo

evidently-sushi's Introduction

evidently-sushi

This is a sample for creating a CloudWatch Evidently project.

Preparation

  • Install AWS CLI
    • v1: 1.22.16 or higher
    • v2: 2.4.3 or higher

Deploy

via CloudFormation

sh ./cfn/10-evidently.sh 'deploy'

Start Launch

aws evidently start-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'

Simple check with AWS CLI

Project

aws evidently get-project \
--project 'FoodProject'

Feature

aws evidently get-feature \
--project 'FoodProject' \
--feature 'SushiFeature'

Launch

aws evidently get-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'

Evaluate Feature

Run the "evaluate-feature" API 10 times with different EntityIDs.

for i in `seq 10`; do
  aws evidently evaluate-feature \
  --project 'FoodProject' \
  --feature 'SushiFeature' \
  --entity-id "$(date -u +'%s')-${i}" \
  --query 'value.stringValue' \
  --output text
  sleep 1
done

Then you will get the following output.

engawa
engawa
uni
tamago
maguro
maguro
tamago
uni
uni
maguro

If you specify the EntityID set in EntityOverrides, a fixed value will be returned regardless of the percentage of traffic.

for i in `seq 10`; do
  aws evidently evaluate-feature \
  --project 'FoodProject' \
  --feature 'SushiFeature' \
  --entity-id 'shari' \
  --query 'value.stringValue' \
  --output text
done

The output will look like the following

no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta

Start proxy server at local

Start a proxy server in your local environment to run CloudWatch Evidently's EvaluateFeature API.

cd app && go run .

You can get a summary of the Evidently::EvaluateFeature results as a Response by making a request to http://localhost:8080/features/evaluate.

curl 'http://localhost:8080/features/evaluate' | jq .
{
  "entityId": "16c83217c7058878",
  "name": "SushiFeature",
  "reason": "LAUNCH_RULE_MATCH",
  "value": "uni"
}

You can use a fixed EntityID by specifying a specific value for the query parameter entity_id.

curl 'http://localhost:8080/features/evaluate?entity_id=shari' | jq .
{
  "entityId": "shari",
  "name": "SushiFeature",
  "reason": "ENTITY_OVERRIDES_MATCH",
  "value": "no neta"
}

evidently-sushi's People

Contributors

michimani avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.