示例#1
0
        private int GetImpressionRefreshRate(ImpressionsMode impressionsMode, int?impressionsRefreshRate)
        {
            switch (impressionsMode)
            {
            case ImpressionsMode.Debug:
                return(impressionsRefreshRate == null || impressionsRefreshRate <= 0 ? 60 : impressionsRefreshRate.Value);

            case ImpressionsMode.Optimized:
            default:
                return(impressionsRefreshRate == null || impressionsRefreshRate <= 0 ? 300 : Math.Max(60, impressionsRefreshRate.Value));
            }
        }
示例#2
0
 public ImpressionsManager(IImpressionsLog impressionsLog,
                           IImpressionListener customerImpressionListener,
                           IImpressionsCounter impressionsCounter,
                           bool addPreviousTime,
                           ImpressionsMode impressionsMode,
                           IImpressionsObserver impressionsObserver = null)
 {
     _impressionsLog             = impressionsLog;
     _customerImpressionListener = customerImpressionListener;
     _impressionsCounter         = impressionsCounter;
     _addPreviousTime            = addPreviousTime;
     _optimized           = impressionsMode == ImpressionsMode.Optimized && addPreviousTime;
     _impressionsObserver = impressionsObserver;
 }
示例#3
0
 public ImpressionsManager(IImpressionsLog impressionsLog,
                           IImpressionListener customerImpressionListener,
                           IImpressionsCounter impressionsCounter,
                           bool addPreviousTime,
                           ImpressionsMode impressionsMode,
                           ITelemetryRuntimeProducer telemetryRuntimeProducer,
                           ITasksManager taskManager,
                           IImpressionsObserver impressionsObserver = null)
 {
     _impressionsLog             = impressionsLog;
     _customerImpressionListener = customerImpressionListener;
     _impressionsCounter         = impressionsCounter;
     _addPreviousTime            = addPreviousTime;
     _optimized                = impressionsMode == ImpressionsMode.Optimized && addPreviousTime;
     _impressionsObserver      = impressionsObserver;
     _telemetryRuntimeProducer = telemetryRuntimeProducer;
     _taskManager              = taskManager;
 }