www/category-category-module-es5.js
/**
     * Processes config coming either from calling RC or from local storage.
     * This method only runs if call is successful or config in storage
     * is valid.
     */
Processes config coming either from calling RC or from local storage.
This method only runs if call is successful or config in storage
is valid.
Processes config coming either from calling RC or from local storage . This method only runs if call is successful or config in storage is valid .
function processConfig(iid, config) {
      if (!config) {
        return config;
      }
      var settingsServiceInstance = SettingsService.getInstance();
      var entries = config.entries || {};
      var state = config.state;
      if (entries.fpr_enabled !== undefined) {
        settingsServiceInstance.loggingEnabled = String(entries.fpr_enabled) === 'true';
      } else {
        settingsServiceInstance.loggingEnabled = DEFAULT_CONFIGS.loggingEnabled;
      }
      if (entries.fpr_log_source) {
        settingsServiceInstance.logSource = Number(entries.fpr_log_source);
      }
      if (entries.fpr_log_endpoint_url) {
        settingsServiceInstance.logEndPointUrl = entries.fpr_log_endpoint_url;
      } 
      if (entries.fpr_log_transport_key) {
        settingsServiceInstance.transportKey = entries.fpr_log_transport_key;
      } 
      if (state === undefined || state === 'INSTANCE_STATE_UNSPECIFIED' || state === 'NO_TEMPLATE') {
        {
          settingsServiceInstance.shouldSendToFl = NO_TEMPLATE_CONFIGS.shouldSendToFl;
        }
      } else if (entries.fpr_log_transport_web_percent) {
        settingsServiceInstance.shouldSendToFl = isDestFl(iid, Number(entries.fpr_log_transport_web_percent));
      } else {
        settingsServiceInstance.shouldSendToFl = DEFAULT_CONFIGS.shouldSendToFl;
      }
      if (entries.fpr_vc_network_request_sampling_rate !== undefined) {
        settingsServiceInstance.networkRequestsSamplingRate = Number(entries.fpr_vc_network_request_sampling_rate);
      }
      if (entries.fpr_vc_trace_sampling_rate !== undefined) {
        settingsServiceInstance.tracesSamplingRate = Number(entries.fpr_vc_trace_sampling_rate);
      } 
      settingsServiceInstance.logTraceAfterSampling = shouldLogAfterSampling(settingsServiceInstance.tracesSamplingRate);
      settingsServiceInstance.logNetworkAfterSampling = shouldLogAfterSampling(settingsServiceInstance.networkRequestsSamplingRate);
      return config;
    }
function processConfig ( iid , config ) { if ( ! config ) { return config ; } var settingsServiceInstance = SettingsService . getInstance ( ) ; var entries = config . entries || { } ; var state = config . state ; if ( entries . fpr_enabled !== undefined ) { settingsServiceInstance . loggingEnabled = String ( entries . fpr_enabled ) === 'true' ; } else { settingsServiceInstance . loggingEnabled = DEFAULT_CONFIGS . loggingEnabled ; } if ( entries . fpr_log_source ) { settingsServiceInstance . logSource = Number ( entries . fpr_log_source ) ; } if ( entries . fpr_log_endpoint_url ) { settingsServiceInstance . logEndPointUrl = entries . fpr_log_endpoint_url ; } if ( entries . fpr_log_transport_key ) { settingsServiceInstance . transportKey = entries . fpr_log_transport_key ; } if ( state === undefined || state === 'INSTANCE_STATE_UNSPECIFIED' || state === 'NO_TEMPLATE' ) { { settingsServiceInstance . shouldSendToFl = NO_TEMPLATE_CONFIGS . shouldSendToFl ; } } else if ( entries . fpr_log_transport_web_percent ) { settingsServiceInstance . shouldSendToFl = isDestFl ( iid , Number ( entries . fpr_log_transport_web_percent ) ) ; } else { settingsServiceInstance . shouldSendToFl = DEFAULT_CONFIGS . shouldSendToFl ; } if ( entries . fpr_vc_network_request_sampling_rate !== undefined ) { settingsServiceInstance . networkRequestsSamplingRate = Number ( entries . fpr_vc_network_request_sampling_rate ) ; } if ( entries . fpr_vc_trace_sampling_rate !== undefined ) { settingsServiceInstance . tracesSamplingRate = Number ( entries . fpr_vc_trace_sampling_rate ) ; } settingsServiceInstance . logTraceAfterSampling = shouldLogAfterSampling ( settingsServiceInstance . tracesSamplingRate ) ; settingsServiceInstance . logNetworkAfterSampling = shouldLogAfterSampling ( settingsServiceInstance . networkRequestsSamplingRate ) ; return config ; }
Processes config coming either from calling RC or from local storage.
Processes config coming either from calling RC or from local storage .
// TODO: Change the assignment of loggingEnabled once the received type is // known. // Config retrieved successfully, but there is no fpr_enabled in template. // Use secondary configs value. // Key from Remote Config has to be non-empty string, otherwsie use local value. // If config object state indicates that no template has been set, that means it is new user of // Performance Monitoring and should use the old log endpoint, because it is guaranteed to work. // If config object state doesn't indicate no template, it can only be UPDATE for now. // - Performance Monitoring doesn't set etag in request, therefore state cannot be NO_CHANGE. // - Sampling rate flags and master flag are required, therefore state cannot be EMPTY_CONFIG. // If config object state is UPDATE and rollout flag is present, determine endpoint by iid. // If config object state is UPDATE and rollout flag is not present, that means rollout is // complete and rollout flag is deprecated, therefore dispatch events to new transport endpoint. // Set the per session trace and network logging flags.