Skip to content

A simple NodeJS app to test LaunchDarkly's Flag Delivery Network performance

Notifications You must be signed in to change notification settings

launchdarkly-labs/ld-test-fdn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ld-test-fdn

A simple NodeJS app to test LaunchDarkly's Flag Delivery Network performance.

This test measures the time it takes for a flag change in LaunchDarkly SaaS to reach client code.

Test logic:

  1. Toggle the flag with the given flagKey in LaunchDarkly (via Flags PATCH API call)
  2. Get the flag's lastModified timestamp value from the API call response
  3. Get a current timestamp when the LDClient's on('update:flagKey') handler fires
  4. Compare the the two timestamps

Setup

npm i

Update the following values in your .env file (or pass them in via command line args)

LD_SDK_KEY=<your SDK key>
LD_API_TOKEN=<your API token>
LD_PROJECT=<your LD project key>
LD_ENVIRONMENT=<your LD environment key>
LD_FLAG_KEY=<your LD flag key>
LD_CONTEXT=<your LD context object, must be valid JSON string>

Example LD_Context value: '{ "kind": "user", "key": "fdntest" }'

Run

If using parameters in a .env file:

node app.mjs

If passing values via args:

node app.mjs --sdkKey abc123 --apiToken asdf etc etc

To see the full list of available parameters:

node app.mjs --help

About

A simple NodeJS app to test LaunchDarkly's Flag Delivery Network performance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published