private void btnAverageCountExample_Push_Click(object sender, EventArgs e) { long value = 0; if (!long.TryParse(txtAverageCountExample.Text, out value)) { MessageBox.Show(String.Format("'{0}' is not a valid value.", txtAverageCountExample.Text), "Warning"); } else { counterHelper.IncrementBy(MultiInstance_PerformanceCounters.AverageCountExample, value); //counterHelper.Increment(MultiInstance_PerformanceCounters.AverageCountExampleBase); } }
// GET: /Store/Browse?genre=Disco public async Task <ActionResult> Browse(string genre) { var stopwatch = Stopwatch.StartNew(); var resultView = View(await _storeContext.Genres.Include("Albums").SingleAsync(g => g.Name == genre)); stopwatch.Stop(); _counterHelper.IncrementBy(ControllersCounters.ProcessingBrowseRequestAverageTime, stopwatch.ElapsedTicks); return(resultView); }