Esempio n. 1
0
        public async Task SendUsageStatistics(TimeSpan duration, Job job, string status)
        {
            if (EnableUsageStatistics)
            {
                var usageMetric = CreateJobUsageStatisticsMetric(job, duration, status);

                await _sender.SendAsync(usageMetric);

                IncreaseGlobalCounters(job.JobInfo.Metadata.Author);
            }
        }
Esempio n. 2
0
        private void HandleClick(BannerDefinition banner, string url)
        {
            url = UrlHelper.AddUrlParameters(url, banner.LinkParameters);

            if (!string.IsNullOrWhiteSpace(banner.Campaign))
            {
                url = UrlHelper.AddUrlParameters(url, "cmp", banner.Campaign);
            }

            try
            {
                _processStarter.Start(url);

                var metric = _bannerMetricFactory.BuildMetric(banner, BannerMetricType.Click);
                _usageStatisticsSender.SendAsync(metric);
            }
            catch { }
        }