in Microsoft.Azure.Cosmos/src/DocumentClientEventSource.cs [332:518]
private unsafe void Response(Guid activityId,
Guid localId,
short statusCode,
double milliseconds,
// the following parameters are response headers
string contentType,
string contentEncoding,
string contentLength,
string contentLocation,
string currentMediaStorageUsageInMB,
string currentResourceQuotaUsage,
string databaseAccountConsumedDocumentStorageInMB,
string databaseAccountProvisionedDocumentStorageInMB,
string databaseAccountReservedDocumentStorageInMB,
string gatewayVersion,
string indexingDirective,
string itemCount,
string lastStateChangeUtc,
string maxMediaStorageUsageInMB,
string maxResourceQuota,
string newResourceId,
string ownerFullName,
string ownerId,
string requestCharge,
string requestValidationFailure,
string retryAfter,
string retryAfterInMilliseconds,
string serverVersion,
string schemaVersion,
string sessionToken,
string version)
{
if (contentType == null) throw new ArgumentException("contentType");
if (contentEncoding == null) throw new ArgumentException("contentEncoding");
if (contentLength == null) throw new ArgumentException("contentLength");
if (contentLocation == null) throw new ArgumentException("contentLocation");
if (currentMediaStorageUsageInMB == null) throw new ArgumentException("currentMediaStorageUsageInMB");
if (currentResourceQuotaUsage == null) throw new ArgumentException("currentResourceQuotaUsage");
if (databaseAccountConsumedDocumentStorageInMB == null) throw new ArgumentException("databaseAccountConsumedDocumentStorageInMB");
if (databaseAccountProvisionedDocumentStorageInMB == null) throw new ArgumentException("databaseAccountProvisionedDocumentStorageInMB");
if (databaseAccountReservedDocumentStorageInMB == null) throw new ArgumentException("databaseAccountReservedDocumentStorageInMB");
if (gatewayVersion == null) throw new ArgumentException("gatewayVersion");
if (indexingDirective == null) throw new ArgumentException("indexingDirective");
if (itemCount == null) throw new ArgumentException("itemCount");
if (lastStateChangeUtc == null) throw new ArgumentException("lastStateChangeUtc");
if (maxMediaStorageUsageInMB == null) throw new ArgumentException("maxMediaStorageUsageInMB");
if (maxResourceQuota == null) throw new ArgumentException("maxResourceQuota");
if (newResourceId == null) throw new ArgumentException("newResourceId");
if (ownerFullName == null) throw new ArgumentException("ownerFullName");
if (ownerId == null) throw new ArgumentException("ownerId");
if (requestCharge == null) throw new ArgumentException("requestCharge");
if (requestValidationFailure == null) throw new ArgumentException("requestValidationFailure");
if (retryAfter == null) throw new ArgumentException("retryAfter");
if (retryAfterInMilliseconds == null) throw new ArgumentException("retryAfterInMilliseconds");
if (serverVersion == null) throw new ArgumentException("serverVersion");
if (schemaVersion == null) throw new ArgumentException("schemaVersion");
if (sessionToken == null) throw new ArgumentException("sessionToken");
if (version == null) throw new ArgumentException("version");
byte[] guidBytes = activityId.ToByteArray();
byte[] localIdBytes = localId.ToByteArray();
fixed (byte* fixedGuidBytes = guidBytes)
fixed (byte* fixedLocalIdBytes = localIdBytes)
fixed (char* fixedContentType = contentType)
fixed (char* fixedContentEncoding = contentEncoding)
fixed (char* fixedContentLength = contentLength)
fixed (char* fixedContentLocation = contentLocation)
fixed (char* fixedCurrentMediaStorageUsageInMB = currentMediaStorageUsageInMB)
fixed (char* fixedCurrentResourceQuotaUsage = currentResourceQuotaUsage)
fixed (char* fixedDatabaseAccountConsumedDocumentStorageInMB = databaseAccountConsumedDocumentStorageInMB)
fixed (char* fixedDatabaseAccountProvisionedDocumentStorageInMB = databaseAccountProvisionedDocumentStorageInMB)
fixed (char* fixedDatabaseAccountReservedDocumentStorageInMB = databaseAccountReservedDocumentStorageInMB)
fixed (char* fixedGatewayVersion = gatewayVersion)
fixed (char* fixedIndexingDirective = indexingDirective)
fixed (char* fixedItemCount = itemCount)
fixed (char* fixedLastStateChangeUtc = lastStateChangeUtc)
fixed (char* fixedMaxMediaStorageUsageInMB = maxMediaStorageUsageInMB)
fixed (char* fixedMaxResourceQuota = maxResourceQuota)
fixed (char* fixedNewResourceId = newResourceId)
fixed (char* fixedOwnerFullName = ownerFullName)
fixed (char* fixedOwnerId = ownerId)
fixed (char* fixedRequestCharge = requestCharge)
fixed (char* fixedRequestValidationFailure = requestValidationFailure)
fixed (char* fixedRetryAfter = retryAfter)
fixed (char* fixedRetryAfterInMilliseconds = retryAfterInMilliseconds)
fixed (char* fixedServerVersion = serverVersion)
fixed (char* fixedSchemaVersion = schemaVersion)
fixed (char* fixedSessionToken = sessionToken)
fixed (char* fixedVersion = version)
{
const int eventDataCount = 30;
const int UnicodeEncodingCharSize = CustomTypeExtensions.UnicodeEncodingCharSize;
EventData* dataDesc = stackalloc EventData[eventDataCount];
dataDesc[0].DataPointer = (IntPtr)(fixedGuidBytes);
dataDesc[0].Size = guidBytes.Length;
dataDesc[1].DataPointer = (IntPtr)(fixedLocalIdBytes);
dataDesc[1].Size = localIdBytes.Length;
dataDesc[2].DataPointer = (IntPtr)(&statusCode);
dataDesc[2].Size = 2;
dataDesc[3].DataPointer = (IntPtr)(&milliseconds);
dataDesc[3].Size = 8;
dataDesc[4].DataPointer = (IntPtr)(fixedContentType);
dataDesc[4].Size = (contentType.Length + 1) * UnicodeEncodingCharSize;
dataDesc[5].DataPointer = (IntPtr)(fixedContentEncoding);
dataDesc[5].Size = (contentEncoding.Length + 1) * UnicodeEncodingCharSize;
dataDesc[6].DataPointer = (IntPtr)(fixedContentLength);
dataDesc[6].Size = (contentLength.Length + 1) * UnicodeEncodingCharSize;
dataDesc[7].DataPointer = (IntPtr)(fixedContentLocation);
dataDesc[7].Size = (contentLocation.Length + 1) * UnicodeEncodingCharSize;
dataDesc[8].DataPointer = (IntPtr)(fixedCurrentMediaStorageUsageInMB);
dataDesc[8].Size = (currentMediaStorageUsageInMB.Length + 1) * UnicodeEncodingCharSize;
dataDesc[9].DataPointer = (IntPtr)(fixedCurrentResourceQuotaUsage);
dataDesc[9].Size = (currentResourceQuotaUsage.Length + 1) * UnicodeEncodingCharSize;
dataDesc[10].DataPointer = (IntPtr)(fixedDatabaseAccountConsumedDocumentStorageInMB);
dataDesc[10].Size = (databaseAccountConsumedDocumentStorageInMB.Length + 1) * UnicodeEncodingCharSize;
dataDesc[11].DataPointer = (IntPtr)(fixedDatabaseAccountProvisionedDocumentStorageInMB);
dataDesc[11].Size = (databaseAccountProvisionedDocumentStorageInMB.Length + 1) * UnicodeEncodingCharSize;
dataDesc[12].DataPointer = (IntPtr)(fixedDatabaseAccountReservedDocumentStorageInMB);
dataDesc[12].Size = (databaseAccountReservedDocumentStorageInMB.Length + 1) * UnicodeEncodingCharSize;
dataDesc[13].DataPointer = (IntPtr)(fixedGatewayVersion);
dataDesc[13].Size = (gatewayVersion.Length + 1) * UnicodeEncodingCharSize;
dataDesc[14].DataPointer = (IntPtr)(fixedIndexingDirective);
dataDesc[14].Size = (indexingDirective.Length + 1) * UnicodeEncodingCharSize;
dataDesc[15].DataPointer = (IntPtr)(fixedItemCount);
dataDesc[15].Size = (itemCount.Length + 1) * UnicodeEncodingCharSize;
dataDesc[16].DataPointer = (IntPtr)(fixedLastStateChangeUtc);
dataDesc[16].Size = (lastStateChangeUtc.Length + 1) * UnicodeEncodingCharSize;
dataDesc[17].DataPointer = (IntPtr)(fixedMaxMediaStorageUsageInMB);
dataDesc[17].Size = (maxMediaStorageUsageInMB.Length + 1) * UnicodeEncodingCharSize;
dataDesc[18].DataPointer = (IntPtr)(fixedMaxResourceQuota);
dataDesc[18].Size = (maxResourceQuota.Length + 1) * UnicodeEncodingCharSize;
dataDesc[19].DataPointer = (IntPtr)(fixedNewResourceId);
dataDesc[19].Size = (newResourceId.Length + 1) * UnicodeEncodingCharSize;
dataDesc[20].DataPointer = (IntPtr)(fixedOwnerFullName);
dataDesc[20].Size = (ownerFullName.Length + 1) * UnicodeEncodingCharSize;
dataDesc[21].DataPointer = (IntPtr)(fixedOwnerId);
dataDesc[21].Size = (ownerId.Length + 1) * UnicodeEncodingCharSize;
dataDesc[22].DataPointer = (IntPtr)(fixedRequestCharge);
dataDesc[22].Size = (requestCharge.Length + 1) * UnicodeEncodingCharSize;
dataDesc[23].DataPointer = (IntPtr)(fixedRequestValidationFailure);
dataDesc[23].Size = (requestValidationFailure.Length + 1) * UnicodeEncodingCharSize;
dataDesc[24].DataPointer = (IntPtr)(fixedRetryAfter);
dataDesc[24].Size = (retryAfter.Length + 1) * UnicodeEncodingCharSize;
dataDesc[25].DataPointer = (IntPtr)(fixedRetryAfterInMilliseconds);
dataDesc[25].Size = (retryAfterInMilliseconds.Length + 1) * UnicodeEncodingCharSize;
dataDesc[26].DataPointer = (IntPtr)(fixedServerVersion);
dataDesc[26].Size = (serverVersion.Length + 1) * UnicodeEncodingCharSize;
dataDesc[27].DataPointer = (IntPtr)(fixedSchemaVersion);
dataDesc[27].Size = (schemaVersion.Length + 1) * UnicodeEncodingCharSize;
dataDesc[28].DataPointer = (IntPtr)(fixedSessionToken);
dataDesc[28].Size = (sessionToken.Length + 1) * UnicodeEncodingCharSize;
dataDesc[29].DataPointer = (IntPtr)(fixedVersion);
dataDesc[29].Size = (version.Length + 1) * UnicodeEncodingCharSize;
this.WriteEventCoreWithActivityId(activityId, 2, eventDataCount, dataDesc);
}
}