public static RequestResponseData GetSample()
        {
            RequestResponseData data = new RequestResponseData();
            data.ID = Guid.NewGuid();
            data.UserAgent = "Test";

            return data;
        }
 /// <summary>
 /// Deletes a particular request and response data item from Redis
 /// </summary>
 /// <param name="data">Data to be deleted</param>
 public override void Delete(RequestResponseData data)
 {
     try
     {
         _client.Del(data.ID.ToString());
     }
     catch (Exception ex)
     {
         Trace.Write(ex.Message);
     }
 }
 /// <summary>
 /// Writes request and response raw data into Redis
 /// </summary>
 /// <param name="data">Request and response metrics in raw form</param>
 public override void Write(RequestResponseData data)
 {
     try
     {
         _client.Add<RequestResponseData>(data.ID.ToString(), data, TimeSpan.FromMinutes(base.configuration.RedisTimeToLive));
     }
     catch (Exception ex)
     {
         Trace.Write(ex.Message);
     }
 }
        public void LoadConfiguration()
        {
            Mock<IApiMeterConfiguration> configMock = new Moq.Mock<IApiMeterConfiguration>();
            configMock.SetupProperty(d => d.RedisServerUrl, "localhost");
            configMock.SetupProperty(d => d.RedisServerPort, 6379);
            configMock.SetupProperty(d => d.RedisConnectionTimeout, 1000);
            configMock.SetupProperty(d => d.RedisSendTimeout, 500);
            configMock.SetupProperty(d => d.RedisTimeToLive, 30);

            configuration = configMock.Object;

            data = RequestResponseDataGenerator.GetSample();
        }
 /// <summary>
 /// Deletes a particular request and response data item from buffer data storage
 /// </summary>
 /// <param name="data">Data to be deleted</param>
 public abstract void Delete(RequestResponseData data);
 /// <summary>
 /// Writes request and response raw data to a buffer data storage
 /// </summary>
 /// <param name="data">Data to be stored</param>
 public abstract void Write(RequestResponseData data);
Exemplo n.º 7
0
 public void Dispose()
 {
     this._timer = null;
     this._data = null;
 }
 /// <summary>
 /// Deletes a particular request and response data item from Kafka
 /// </summary>
 /// <param name="data">Data to be deleted</param>
 public override async void Delete(RequestResponseData data)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Sends request and response raw data to Kafka
 /// </summary>
 /// <param name="data">Request and response metrics in raw form</param>
 public override void Write(RequestResponseData data)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
        private void ValidateData(RequestResponseData data)
        {
            

        }
Exemplo n.º 11
0
 public void WriteRequestResponse(IApiMeterConfiguration apiConfiguration, RequestResponseData data)
 {
     RedisBufferDataProvider dataProvider = new RedisBufferDataProvider(apiConfiguration);
     dataProvider.Write(data);
 }
Exemplo n.º 12
0
 public void WriteRequestResponse(string configurationFilePath, RequestResponseData data)
 {
     RedisBufferDataProvider dataProvider = new RedisBufferDataProvider(new ApiMeterConfiguration(configurationFilePath));
     dataProvider.Write(data);
 }