public static Task ProcessAsync(
     IStatisticsProcesser processer,
     IStatisticsWriter writer,
     BrokeredMessage message)
 {
     throw new NotImplementedException();
 }
Beispiel #2
0
 private static void Run(
     IQueueFactory queueFactory,
     IStatisticsProcesser processer,
     IStatisticsWriter writer)
 {
     var q = queueFactory.Create();
     q.OnMessageAsync(msg => MessageProcessor.ProcessAsync(processer, writer, msg),
         new OnMessageOptions {AutoComplete = false});
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="StatisticsTracer"/> class with the given logical operation name.
        /// </summary>
        /// <remarks>
        /// If an existing activity id is already set, it will be kept. Otherwise, a new activity id will be created.
        /// </remarks>
        /// <param name="operation">
        /// The operation for the <see cref="StatisticsTracer"/>
        /// </param>
        /// <param name="writer">
        /// The <see cref="StatisticsTracer"/> that is used to write trace messages
        /// </param>
        /// <param name="priority">
        /// The priority.
        /// </param>
        public StatisticsTracer(string operation, IStatisticsWriter writer, int priority)
        {
            Priority = priority;

            if (CheckTracingAvailable())
            {
                if (writer == null)
                {
                    throw new ArgumentNullException("writer");
                }

                _writer = writer;

                Initialize(operation);
            }
        }
Beispiel #4
0
        public bool IsActive(IStatisticsWriter writer, IToggleContext context)
        {
            var stats = new Statistic
            {
                ToggleID  = ID,
                Timestamp = DateTime.Now,
                User      = context.GetCurrentUser()
            };

            var isActive = ConditionMode == ConditionModes.Any
                                ? Conditions.Any(c => c.IsMatch(stats, context))
                                : Conditions.All(c => c.IsMatch(stats, context));

            stats.Active = isActive;

            writer.Write(stats);

            return(isActive);
        }
 private IStatisticsWriter GetWriter()
 {
     return(_writer ?? (_writer = new DebugStatisticsWriter()));
 }
 public static StatisticsTracer NewStatisticsTracer(string operation, IStatisticsWriter writer, int priority)
 {
     return(new StatisticsTracer(operation, writer, priority));
 }
Beispiel #7
0
 public StatisticsCommand(IStatisticsWriter writer, IStatsQueryCommand[] statsQueries)
 {
     _Writer       = writer ?? throw new ArgumentNullException(nameof(writer));
     _StatsQueries = statsQueries ?? throw new ArgumentNullException(nameof(statsQueries));
 }
Beispiel #8
0
 public ToggleService(IToggleFetcher fetcher, IStatisticsWriter writer)
 {
     _fetcher = fetcher;
     _writer  = writer;
 }