private void CheckRequiredParameters(out string serviceUrl, out string apiKey)
 {
     serviceUrl = SysSettings.GetValue(_userConnection,
                                       EmailMiningConsts.TextParsingServiceSysSetting, string.Empty);
     if (serviceUrl.IsNullOrEmpty())
     {
         _metricReporter.Gauge(EmailMiningUnreachableMetricName, 1);
         throw new IncorrectConfigurationException(EmailMiningConsts.TextParsingServiceSysSetting);
     }
     apiKey = BpmonlineCloudEngine.GetAPIKey(_userConnection);
     if (apiKey.IsNullOrEmpty())
     {
         _metricReporter.Gauge(EmailMiningUnreachableMetricName, 1);
         throw new IncorrectConfigurationException(CloudServicesAPIKey);
     }
 }
示例#2
0
        private void PublishEmailEnrichmentMetrics(Entity activity)
        {
            var startDate         = activity.GetTypedColumnValue <DateTime>("CreatedOn");
            var now               = _userConnection.CurrentUser.GetCurrentDateTime();
            var miningDurationSec = now.Subtract(startDate).TotalSeconds;

            _metricReporter.Gauge(EmailMiningTimeMetricName, miningDurationSec);
        }
示例#3
0
        /// <inheritdoc cref="IDeduplicationManager.FindDuplicates"/>
        public DuplicatesCollection FindDuplicates(FindDuplicatesRequest findDuplicatesOnSaveRequest)
        {
            var timer = new Stopwatch();

            try {
                timer.Start();
                var entityRules = _duplicatesRuleManager
                                  .GetDuplicatesRules(findDuplicatesOnSaveRequest.SchemaName);
                return(FindSimilarRecords(entityRules.ToList(), findDuplicatesOnSaveRequest));
            }
            finally {
                timer.Stop();
                _metricReporter.Gauge(DuplicationSearchDurationMetricName, timer.ElapsedMilliseconds);
            }
        }
示例#4
0
 private void SendErrorMetric()
 {
     _metricReporter.Gauge(FullPipelineErrorMetricName, 1);
 }