Example #1
0
 //------------------------------------------------------------------------------
 //
 // Method: LogAmountMetricTotal
 //
 //------------------------------------------------------------------------------
 /// <summary>
 /// Logs the total of an amount metric to a performance counter.
 /// </summary>
 /// <param name="amountMetric">The amount metric to log.</param>
 /// <param name="value">The total.</param>
 protected override void LogAmountMetricTotal(AmountMetric amountMetric, long value)
 {
     if (registeredMetricsPerformanceCounters.ContainsKey(amountMetric.Name) == true)
     {
         registeredMetricsPerformanceCounters[amountMetric.Name].RawValue = value;
     }
 }
Example #2
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.AmountMetric,System.String,System.String)"]/*'/>
 public override void DefineMetricAggregate(AmountMetric numeratorAmountMetric, AmountMetric denominatorAmountMetric, string name, string description)
 {
     ValidateMetricAggregateName(name, performanceCounterAggregateBasePostFix);
     base.DefineMetricAggregate(numeratorAmountMetric, denominatorAmountMetric, name, description);
     RegisterPerformanceCounter(name);
     RegisterPerformanceCounter(CounterNameAppendBase(name));
 }
Example #3
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.CountMetric,System.String,System.String)"]/*'/>
 public override void DefineMetricAggregate(AmountMetric amountMetric, CountMetric countMetric, string name, string description)
 {
     ValidateMetricAggregateName(name, performanceCounterAggregateInstantaneousPostFix + performanceCounterAggregateBasePostFix);
     base.DefineMetricAggregate(amountMetric, countMetric, name, description);
     RegisterPerformanceCounter(name);
     RegisterPerformanceCounter(CounterNameAppendInstantaneous(name));
     RegisterPerformanceCounter(CounterNameAppendInstantaneousBase(name));
 }
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricLogger.Add(ApplicationMetrics.AmountMetric)"]/*'/>
 public void Add(AmountMetric amountMetric)
 {
     lock (amountMetricEventQueueLock)
     {
         amountMetricEventQueue.Enqueue(new AmountMetricEventInstance(amountMetric, dateTime.UtcNow));
         bufferProcessingStrategy.NotifyAmountMetricEventBuffered();
     }
 }
Example #5
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.TimeUnit,System.String,System.String)"]/*'/>
 public override void DefineMetricAggregate(AmountMetric amountMetric, TimeUnit timeUnit, string name, string description)
 {
     ValidateMetricAggregateName(name, performanceCounterAggregateInstantaneousPostFix + performanceCounterAggregateBasePostFix);
     base.DefineMetricAggregate(amountMetric, timeUnit, name, description);
     RegisterPerformanceCounter(name);
     RegisterPerformanceCounter(CounterNameAppendInstantaneous(name));
     // If the time unit of the aggregate is not second, the instantaneous counter is of type AverageCount64 which requires a base counter...
     if (timeUnit != TimeUnit.Second)
     {
         RegisterPerformanceCounter(CounterNameAppendInstantaneousBase(name));
     }
 }
Example #6
0
 //------------------------------------------------------------------------------
 //
 // Method: LogAmountMetricTotal
 //
 //------------------------------------------------------------------------------
 /// <summary>
 /// Logs the total of an amount metric to the console.
 /// </summary>
 /// <param name="amountMetric">The amount metric to log.</param>
 /// <param name="value">The total.</param>
 protected override void LogAmountMetricTotal(AmountMetric amountMetric, long value)
 {
     console.WriteLine(amountMetric.Name + separatorString + value.ToString());
 }
 //------------------------------------------------------------------------------
 //
 // Method: AmountMetricTotalContainer (constructor)
 //
 //------------------------------------------------------------------------------
 /// <summary>
 /// Initialises a new instance of the ApplicationMetrics.AmountMetricTotalContainer class.
 /// </summary>
 /// <param name="amountMetric">The amount metric for which the total stored.</param>
 public AmountMetricTotalContainer(AmountMetric amountMetric)
 {
     this.amountMetric = amountMetric;
     total             = 0;
 }
Example #8
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.AmountMetric,System.String,System.String)"]/*'/>
 public void DefineMetricAggregate(AmountMetric numeratorAmountMetric, AmountMetric denominatorAmountMetric, string name, string description)
 {
     loggerImplementation.DefineMetricAggregate(numeratorAmountMetric, denominatorAmountMetric, name, description);
 }
Example #9
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.TimeUnit,System.String,System.String)"]/*'/>
 public void DefineMetricAggregate(AmountMetric amountMetric, TimeUnit timeUnit, string name, string description)
 {
     loggerImplementation.DefineMetricAggregate(amountMetric, timeUnit, name, description);
 }
Example #10
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.CountMetric,System.String,System.String)"]/*'/>
 public void DefineMetricAggregate(AmountMetric amountMetric, CountMetric countMetric, string name, string description)
 {
     loggerImplementation.DefineMetricAggregate(amountMetric, countMetric, name, description);
 }
Example #11
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricLogger.Add(ApplicationMetrics.AmountMetric)"]/*'/>
 public void Add(AmountMetric amountMetric)
 {
     loggerImplementation.Add(amountMetric);
 }
Example #12
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricLogger.Add(ApplicationMetrics.AmountMetric)"]/*'/>
 public void Add(AmountMetric amountMetric)
 {
 }
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.AmountMetric,System.String,System.String)"]/*'/>
 public virtual void DefineMetricAggregate(AmountMetric numeratorAmountMetric, AmountMetric denominatorAmountMetric, string name, string description)
 {
     CheckDuplicateAggregateName(name);
     amountOverAmountAggregateDefinitions.Add(new MetricAggregateContainer <AmountMetric, AmountMetric>(numeratorAmountMetric, denominatorAmountMetric, name, description));
 }
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricAggregateLogger.DefineMetricAggregate(ApplicationMetrics.AmountMetric,ApplicationMetrics.TimeUnit,System.String,System.String)"]/*'/>
 public virtual void DefineMetricAggregate(AmountMetric amountMetric, TimeUnit timeUnit, string name, string description)
 {
     CheckDuplicateAggregateName(name);
     amountOverTimeUnitAggregateDefinitions.Add(new MetricAggregateContainer <AmountMetric>(amountMetric, timeUnit, name, description));
 }
 //------------------------------------------------------------------------------
 //
 // Method: LogAmountMetricTotal
 //
 //------------------------------------------------------------------------------
 /// <summary>
 /// Logs the total amount of all occurrences of an amount metric.
 /// </summary>
 /// <param name="amountMetric">The amount metric.</param>
 /// <param name="value">The total.</param>
 protected abstract void LogAmountMetricTotal(AmountMetric amountMetric, long value);