コード例 #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;
     }
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #4
0
 /// <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();
     }
 }
コード例 #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));
     }
 }
コード例 #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;
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #12
0
 /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:ApplicationMetrics.IMetricLogger.Add(ApplicationMetrics.AmountMetric)"]/*'/>
 public void Add(AmountMetric amountMetric)
 {
 }
コード例 #13
0
 /// <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));
 }
コード例 #14
0
 /// <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));
 }
コード例 #15
0
 //------------------------------------------------------------------------------
 //
 // 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);