Ejemplo n.º 1
0
 internal void IndexEvent(TelemetryEventBase plainEvent)
 {
     try
     {
         //Check if we can connect to the ElasticSearch Server
         if (_ElasticClient != null &&
             !_ElasticClient.IndexAsync <BytesResponse>(_ElasticIndex, _ElasticType, PostData.Serializable(plainEvent)).Result.Success)
         {
             logger.Error("Server settings are not configured");
             _ElasticClient = null;
             return;
         }
     }
     catch (Exception e) { logger.Fatal(e); }
 }
Ejemplo n.º 2
0
        private AnalyticsWrapper()
        {
            try
            {
                _AppConfig        = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location); //Load custom app.config for this assembly
                _TypeCobolVersion = _AppConfig.AppSettings.Settings["TypeCobolVersion"].Value;

                //Init base event, contains version, generated session id, user id.
                _EventBase = new TelemetryEventBase()
                {
                    SessionId        = Guid.NewGuid().ToString(),
                    UserId           = Environment.UserName,
                    TypeCobolVersion = _TypeCobolVersion
                };
            }
            catch (Exception e) { logger.Fatal(e); }
        }
Ejemplo n.º 3
0
 public TelemetryMetricsEvent(TelemetryEventBase baseEvent, EventType evenType, string metricname, double metricValue) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion)
 {
     EventType   = evenType;
     MetricName  = metricname;
     MetricValue = metricValue;
 }
Ejemplo n.º 4
0
 public TelemetryExceptionEvent(TelemetryEventBase baseEvent, Exception exception, string sourceCode) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion)
 {
     Exception  = exception;
     EventType  = EventType.Exception;
     SourceCode = sourceCode;
 }
Ejemplo n.º 5
0
 public TelemetryEvent(TelemetryEventBase baseEvent, EventType evenType, string content) : base(baseEvent.SessionId, baseEvent.UserId, baseEvent.TypeCobolVersion)
 {
     EventType = evenType;
     Content   = content;
 }