Exemple #1
0
        /// <summary>
        /// Enable performance counters.
        /// </summary>
        /// <param name="name">Instance name.</param>
        /// <param name="perf">Performance counters implementation (platform specific).</param>
        public void EnablePerfCounters(string name, IPerfCounters <PriorityQueueCounters> perf)
        {
            const string Category = "Microsoft Psi scheduler queue";

            if (this.counters != null)
            {
                throw new InvalidOperationException("Perf counters are already enabled for this scheduler");
            }

#pragma warning disable SA1118 // Parameter must not span multiple lines
            perf.AddCounterDefinitions(
                Category,
                new Tuple <PriorityQueueCounters, string, string, PerfCounterType>[]
            {
                Tuple.Create(PriorityQueueCounters.WorkitemCount, "Workitem queue count", "The number of work items in the global queue", PerfCounterType.NumberOfItems32),
                Tuple.Create(PriorityQueueCounters.EnqueuingTime, "Enqueuing time", "The time to enqueue a work item", PerfCounterType.NumberOfItems32),
                Tuple.Create(PriorityQueueCounters.DequeueingTime, "Dequeuing time", "The time to dequeuing a work item", PerfCounterType.NumberOfItems32),
                Tuple.Create(PriorityQueueCounters.EnqueueingRetries, "Enqueuing retry average", "The number of retries per work item enqueue operation.", PerfCounterType.AverageCount64),
                Tuple.Create(PriorityQueueCounters.EnqueueingCount, "Enqueue count", "The base counter for computing the work item enqueuing retry count.", PerfCounterType.AverageBase),
                Tuple.Create(PriorityQueueCounters.DequeuingRetries, "Dequeuing retry average", "The number of retries per work item dequeue operation.", PerfCounterType.AverageCount64),
                Tuple.Create(PriorityQueueCounters.DequeueingCount, "Dequeue count", "The base counter for computing the work item enqueuing retry count.", PerfCounterType.AverageBase)
            });
#pragma warning restore SA1118 // Parameter must not span multiple lines

            this.counters = perf.Enable(Category, name);
        }
Exemple #2
0
        /// <summary>
        /// Enable performance counters.
        /// </summary>
        /// <param name="name">Instance name.</param>
        /// <param name="perf">Performance counters implementation (platform specific).</param>
        public void EnablePerfCounters(string name, IPerfCounters <SchedulerCounters> perf)
        {
            const string Category = "Microsoft Psi scheduler";

            if (this.counters != null)
            {
                throw new InvalidOperationException("Perf counters are already enabled for this scheduler");
            }

#pragma warning disable SA1118 // Parameter must not span multiple lines
            perf.AddCounterDefinitions(
                Category,
                new Tuple <SchedulerCounters, string, string, PerfCounterType>[]
            {
                Tuple.Create(SchedulerCounters.LocalToGlobalPromotions, "Local-to-global promotions", "The percentage of workitems promoted to the global queue", PerfCounterType.AverageCount64),
                Tuple.Create(SchedulerCounters.LocalQueueCount, "Local workitem count", "The number of messages in the thread-local queues", PerfCounterType.AverageBase),
                Tuple.Create(SchedulerCounters.WorkitemsPerSecond, "Workitems / second", "The number of workitems executed per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(SchedulerCounters.GlobalWorkitemsPerSecond, "Global workitems / second", "The number of workitems from the global queue executed per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(SchedulerCounters.LocalWorkitemsPerSecond, "Local workitems / second", "The number of workitems from the thread-local queues executed per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(SchedulerCounters.ImmediateWorkitemsPerSecond, "Immediate workitems / second", "The number of workitems executed synchronously without enqueuing, per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(SchedulerCounters.ActiveThreads, "Active threads", "The count of active threads", PerfCounterType.NumberOfItems32),
            });
#pragma warning restore SA1118 // Parameter must not span multiple lines

            this.counters = perf.Enable(Category, name);
        }
Exemple #3
0
        /// <summary>
        /// Enable performance counters.
        /// </summary>
        /// <param name="name">Instance name.</param>
        /// <param name="perf">Performance counters implementation (platform specific).</param>
        public void EnablePerfCounters(string name, IPerfCounters <ReceiverCounters> perf)
        {
            const string Category = "Microsoft Psi message delivery";

            if (this.counters != null)
            {
                throw new InvalidOperationException("Perf counters are already enabled for this receiver");
            }

#pragma warning disable SA1118 // Parameter must not span multiple lines
            perf.AddCounterDefinitions(
                Category,
                new Tuple <ReceiverCounters, string, string, PerfCounterType>[]
            {
                Tuple.Create(ReceiverCounters.Total, "Total messages / second", "Number of messages received per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(ReceiverCounters.Dropped, "Dropped messages / second", "Number of messages dropped per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(ReceiverCounters.Processed, "Messages / second", "Number of messages processed per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(ReceiverCounters.ProcessingTime, "Processing time (ns)", "The time it takes the component to process a message", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.PipelineExclusiveDelay, "Exclusive pipeline delay (ns)", "The delta between the originating time of the message and the time the message was received.", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.IngestTime, "Ingest time (ns)", "The delta between the time the message was posted and the time the message was received.", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.TimeInQueue, "Time in queue (ns)", "The time elapsed between posting of the message and beginning its processing", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.ProcessingDelay, "Total processing delay (ns)", "The time elapsed between posting of the message and completing its processing.", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.PipelineInclusiveDelay, "Inclusive pipeline delay (ns)", "The end-to-end delay, from originating time to the time when processing completed.", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.QueueSize, "Queue size", "The number of messages waiting in the delivery queue", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.MaxQueueSize, "Max queue size", "The maximum number of messages ever waiting at the same time in the delivery queue", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.ThrottlingRequests, "Throttling requests / second", "The number of throttling requests issued due to queue full, per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(ReceiverCounters.OutstandingUnrecycled, "Unrecycled messages", "The number of messages that are still in use by the component", PerfCounterType.NumberOfItems32),
                Tuple.Create(ReceiverCounters.AvailableRecycled, "Recycled messages", "The number of messages that are available for recycling", PerfCounterType.NumberOfItems32),
            });
#pragma warning restore SA1118 // Parameter must not span multiple lines

            this.counters = perf.Enable(Category, name);
            this.awaitingDelivery.EnablePerfCounters(this.counters);
        }
Exemple #4
0
        /// <summary>
        /// Enable performance counters.
        /// </summary>
        /// <param name="name">Instance name.</param>
        /// <param name="perf">Performance counters implementation (platform specific).</param>
        public void EnablePerfCounters(string name, IPerfCounters <EmitterCounters> perf)
        {
            const string Category = "Microsoft Psi message submission";

            if (this.counters != null)
            {
                throw new InvalidOperationException("Perf counters are already enabled for emitter " + this.Name);
            }

#pragma warning disable SA1118 // Parameter must not span multiple lines
            perf.AddCounterDefinitions(
                Category,
                new Tuple <EmitterCounters, string, string, PerfCounterType>[]
            {
                Tuple.Create(EmitterCounters.MessageCount, "Total messages / second", "Number of messages received per second", PerfCounterType.RateOfCountsPerSecond32),
                Tuple.Create(EmitterCounters.MessageLatency, "Message latency (microseconds)", "The end-to-end latency, from originating time to the time when processing completed.", PerfCounterType.NumberOfItems32),
            });
#pragma warning restore SA1118 // Parameter must not span multiple lines

            this.counters = perf.Enable(Category, name);
        }