/// <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); }
/// <summary> /// Creates a new collection. /// </summary> /// <returns>The collection created.</returns> /// <param name="performance">Performance collection name.</param> public ExecutionTimeDataCollector CreateCollection(string performance) { // - Check if the collector already exists var collector = GetCollection(performance); // - Otherwise we need to create a new collector if (collector == null) { // - Create a new collector collector = new ExecutionTimeDataCollector(performance, SamplesCount); // - Store this collector pCollections.Add(collector); // - Raise the collector creation event OnNewPerformance?.Invoke(this, collector); } return(collector as ExecutionTimeDataCollector); }
/// <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); }