Exemplo n.º 1
0
        private static void WriteEntries(AbstractBlittableJsonTextWriter writer, TimeSeriesEntry[] entries)
        {
            writer.WriteStartArray();

            for (var i = 0; i < entries.Length; i++)
            {
                if (i > 0)
                {
                    writer.WriteComma();
                }

                writer.WriteStartObject();
                {
                    writer.WritePropertyName(nameof(TimeSeriesEntry.Timestamp));
                    writer.WriteDateTime(entries[i].Timestamp, true);
                    writer.WriteComma();
                    writer.WritePropertyName(nameof(TimeSeriesEntry.Tag));
                    writer.WriteString(entries[i].Tag);
                    writer.WriteComma();
                    writer.WriteArray(nameof(TimeSeriesEntry.Values), entries[i].Values);
                    writer.WriteComma();
                    writer.WritePropertyName(nameof(TimeSeriesEntry.IsRollup));
                    writer.WriteBool(entries[i].IsRollup);
                }
                writer.WriteEndObject();
            }

            writer.WriteEndArray();
        }
Exemplo n.º 2
0
        internal void WriteTo(AbstractBlittableJsonTextWriter writer)
        {
            writer.WriteStartObject();

            writer.WritePropertyName(nameof(AssemblyName));
            writer.WriteString(AssemblyName);
            writer.WriteComma();

            writer.WritePropertyName(nameof(AssemblyPath));
            writer.WriteString(AssemblyPath);
            writer.WriteComma();

            writer.WritePropertyName(nameof(PackageName));
            writer.WriteString(PackageName);
            writer.WriteComma();

            writer.WritePropertyName(nameof(PackageVersion));
            writer.WriteString(PackageVersion);
            writer.WriteComma();

            writer.WritePropertyName(nameof(PackageSourceUrl));
            writer.WriteString(PackageSourceUrl);
            writer.WriteComma();

            writer.WriteArray(nameof(Usings), Usings);

            writer.WriteEndObject();
        }
Exemplo n.º 3
0
            public void Write(JsonOperationContext context, AbstractBlittableJsonTextWriter writer)
            {
                writer.WriteStartObject();

                writer.WritePropertyName(nameof(Id));
                writer.WriteString(Id);
                writer.WriteComma();

                writer.WritePropertyName(nameof(Description));
                writer.WriteString(Description);
                writer.WriteComma();

                writer.WritePropertyName(nameof(Type));
                writer.WriteString(Type.ToString());
                writer.WriteComma();

                writer.WriteArray(context, nameof(Performance), Performance, (w, c, p) =>
                {
                    var djv = (DynamicJsonValue)TypeConverter.ToBlittableSupportedType(p);
                    w.WriteObject(c.ReadObject(djv, "incoming/replication/performance"));
                });

                writer.WriteEndObject();
            }