This is a sample for creating a CloudWatch Evidently project.
- Install AWS CLI
- v1:
1.22.16
or higher - v2:
2.4.3
or higher
- v1:
sh ./cfn/10-evidently.sh 'deploy'
aws evidently start-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'
aws evidently get-project \
--project 'FoodProject'
aws evidently get-feature \
--project 'FoodProject' \
--feature 'SushiFeature'
aws evidently get-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'
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 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"
}