<commit_before>import { FeatureFlags } from './../models/constants';
import { Url } from './url';

export class FlightingUtil {
  public static Features = {
    OldDeploymentCenter: 'OldDeploymentCenter',
    NewDeploymentSlots: 'NewDeploymentSlots',
  };

  private static config = {
    OldDeploymentCenter: {
      seed: 422209594,
      percentofUsers: 50,
      forceOnFlag: FeatureFlags.oldDeploymentCenter,
      forceOffFlag: null,
    },
    NewDeploymentSlots: {
      seed: 187465135,
      percentofUsers: 25,
      forceOnFlag: FeatureFlags.UseNewSlotsBlade,
      forceOffFlag: FeatureFlags.ShowLegacySlotsBlade,
    },
  };

  /*
    * Subscription = hash key
    * Seed is a wild card to make sure that the same subscriptions aren't used to flight every feature, this can very on each feature
    * percent of users should be a number between 1 and 100 to represent the percentage of users that should hit the feature.
    *  
    */
  static checkSubscriptionInFlight(subscription: string, feature: string): boolean {
    if (!feature) {
      throw new Error(`Flighted feature must be specified`);
    }

    const config = this.config[feature];
    if (!config) {
      throw new Error(`'${feature}' is not a valid flighted feature`);
    }

    if (config.percentofUsers > 100) {
      throw new Error(`Percent of users can't be higher than 100%`);
    }<commit_msg>AB#3801575 Increase flighting by 25% for Deployment Slots<commit_after>import { FeatureFlags } from './../models/constants';
import { Url } from './url';

export class FlightingUtil {
  public static Features = {
    OldDeploymentCenter: 'OldDeploymentCenter',
    NewDeploymentSlots: 'NewDeploymentSlots',
  };

  private static config = {
    OldDeploymentCenter: {
      seed: 422209594,
      percentofUsers: 25,
      forceOnFlag: FeatureFlags.oldDeploymentCenter,
      forceOffFlag: null,
    },
    NewDeploymentSlots: {
      seed: 187465135,
      percentofUsers: 50,
      forceOnFlag: FeatureFlags.UseNewSlotsBlade,
      forceOffFlag: FeatureFlags.ShowLegacySlotsBlade,
    },
  };

  /*
    * Subscription = hash key
    * Seed is a wild card to make sure that the same subscriptions aren't used to flight every feature, this can very on each feature
    * percent of users should be a number between 1 and 100 to represent the percentage of users that should hit the feature.
    *  
    */
  static checkSubscriptionInFlight(subscription: string, feature: string): boolean {
    if (!feature) {
      throw new Error(`Flighted feature must be specified`);
    }

    const config = this.config[feature];
    if (!config) {
      throw new Error(`'${feature}' is not a valid flighted feature`);
    }

    if (config.percentofUsers > 100) {
      throw new Error(`Percent of users can't be higher than 100%`);
    }
{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.025923295454545456, 'mean_word_length': 3.179525222551929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6266466', 'n_tokens_mistral': 863, 'n_tokens_neox': 800, 'n_words': 267}