public void SerializesCorrectly() { var data = new CrossApplicationResponseData("crossProcessId", "transactionName", 1.1f, 2.2f, 3, "guid"); var serialized = JsonConvert.SerializeObject(data); Assert.AreEqual("[\"crossProcessId\",\"transactionName\",1.1,2.2,3,\"guid\",false]", serialized); }
private string GetEncodedAppData(IInternalTransaction transaction, TransactionMetricName transactionMetricName, string crossProcessId) { var txMetadata = transaction.TransactionMetadata; var queueTime = txMetadata.QueueTime?.TotalSeconds ?? 0; var referrerContentLength = txMetadata.GetCrossApplicationReferrerContentLength(); var responseTimeInSeconds = txMetadata.CrossApplicationResponseTimeInSeconds; var appData = new CrossApplicationResponseData(crossProcessId, transactionMetricName.PrefixedName, (float)queueTime, responseTimeInSeconds, referrerContentLength, transaction.Guid); return(HeaderEncoder.EncodeSerializedData(JsonConvert.SerializeObject(appData), _configurationService.Configuration.EncodingKey)); }