Skip to content

Instantly share code, notes, and snippets.

@einarwh
Last active August 23, 2021 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einarwh/5c4df5130960eba7886ba3045f82ed29 to your computer and use it in GitHub Desktop.
Save einarwh/5c4df5130960eba7886ba3045f82ed29 to your computer and use it in GitHub Desktop.
GetFaultConfig.
private IFaultConfig GetFaultConfig()
{
if (_unleash.IsEnabled("ps-playback-api-channel-blob-storage-inject-fault-always"))
{
return new EnabledFault { InjectionRate = 1.00 };
}
else if (_unleash.IsEnabled("ps-playback-api-channel-blob-storage-inject-fault-terrible-rate"))
{
return new EnabledFault { InjectionRate = 0.90 };
}
else if (_unleash.IsEnabled("ps-playback-api-channel-blob-storage-inject-fault-severe-rate"))
{
return new EnabledFault { InjectionRate = 0.50 };
}
else if (_unleash.IsEnabled("ps-playback-api-channel-blob-storage-inject-fault-moderate-rate"))
{
return new EnabledFault { InjectionRate = 0.20 };
}
else if (_unleash.IsEnabled("ps-playback-api-channel-blob-storage-inject-fault-low-rate"))
{
return new EnabledFault { InjectionRate = 0.05 };
}
else
{
return new DisabledFault();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment