Esempio n. 1
0
        public void WriteEventBegin(EventMetadata metadata, RuntimeEventMetadata runtimeMetadata)
        {
            this.writer.WriteStartObject();
            this.writer.WritePropertyName("Event");
            this.writer.WriteStartObject();

            this.writer.WritePropertyName("Timestamp");
            this.writer.WriteValue(runtimeMetadata.Timestamp);

            this.writer.WritePropertyName("ProviderGuid");
            this.writer.WriteValue(metadata.ProviderGuid);

            this.writer.WritePropertyName("Id");
            this.writer.WriteValue(metadata.Id);

            this.writer.WritePropertyName("Version");
            this.writer.WriteValue(metadata.Version);

            this.writer.WritePropertyName("ProcessId");
            this.writer.WriteValue(runtimeMetadata.ProcessId);

            this.writer.WritePropertyName("ThreadId");
            this.writer.WriteValue(runtimeMetadata.ThreadId);

            var activityId = runtimeMetadata.ActivityId;
            if (activityId != Guid.Empty)
            {
                this.writer.WritePropertyName("ActivityId");
                this.writer.WriteValue(activityId);
            }

            var relatedActivityId = runtimeMetadata.RelatedActivityId;
            if (relatedActivityId != Guid.Empty)
            {
                this.writer.WritePropertyName("RelatedActivityId");
                this.writer.WriteValue(relatedActivityId);
            }

            ulong matchId;
            var stacks = runtimeMetadata.GetStacks(out matchId);
            if (matchId != 0)
            {
                this.writer.WritePropertyName("StackMatchId");
                this.writer.WriteValue(matchId);
            }

            if (stacks != null)
            {
                this.writer.WritePropertyName("Stacks");
                this.writer.WriteStartArray();
                for (int i = 0; i < stacks.Length; ++i)
                {
                    this.writer.WriteValue(stacks[i]);
                }
                this.writer.WriteEndArray();
            }

            this.writer.WritePropertyName("Name");
            this.writer.WriteValue(metadata.Name);

            this.writer.WritePropertyName("Properties");
            this.writer.WriteStartArray();
            this.writer.WriteStartObject();
        }
 internal EventTraceOperand(EventMetadata metadata, int eventMetadataTableIndex, IEnumerable<IEventTracePropertyOperand> operands)
 {
     this.Metadata = metadata;
     this.EventMetadataTableIndex = eventMetadataTableIndex;
     this.EventPropertyOperands = operands;
 }