Пример #1
0
 /// <summary>
 /// Add an existing collector to this collector.
 /// </summary>
 /// <param name="collector">Collector to add.</param>
 public void AddCollector(PerformanceCollector collector)
 {
     if (!pCollections.Contains(collector))
     {
         pCollections.Add(collector);
     }
 }
Пример #2
0
        /// <summary>
        /// Creates a new collection.
        /// </summary>
        /// <returns>The collection created.</returns>
        /// <param name="performance">Performance collection name.</param>
        /// <param name="collectOnRelease">If set to <c>true</c> collect on release build else not.</param>
        public PerformanceCollector CreateCollector(string performance)
        {
            IPerformanceCollection currentPerformance;

            currentPerformance = GetCollection(performance);

            if (currentPerformance == null)
            {
                currentPerformance = new PerformanceCollector(performance);
                collections.Add(currentPerformance);

                OnNewPerformance?.Invoke(currentPerformance);
            }

            return(currentPerformance as PerformanceCollector);
        }
Пример #3
0
        /// <summary>
        /// Creates a new collection.
        /// </summary>
        /// <returns>The collection created.</returns>
        /// <param name="performance">Performance collection name.</param>
        /// <param name="collectOnRelease">If set to <c>true</c> collect on release build else not.</param>
        public PerformanceCollector CreateCollector(string performance)
        {
            // - Check if the collection already exists
            var collection = GetCollection(performance);

            // - If it doesn't exists, create a new one
            if (collection == null)
            {
                // - Create a new collection
                collection = new PerformanceCollector(performance);

                // - Add it in the local storage
                pCollections.Add(collection);

                // - Raise collector event creation
                OnNewPerformance?.Invoke(this, collection);
            }

            return(collection as PerformanceCollector);
        }