58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace ZB.MOM.WW.CBDDC.Sample.Console;
|
|
|
|
/// <summary>
|
|
/// Append-only telemetry log entry used for high-volume sync scenarios.
|
|
/// </summary>
|
|
public class TelemetryLogEntry
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the unique log identifier.
|
|
/// </summary>
|
|
[Key]
|
|
public string Id { get; set; } = Guid.NewGuid().ToString("N");
|
|
|
|
/// <summary>
|
|
/// Gets or sets the log level.
|
|
/// </summary>
|
|
public string Level { get; set; } = "Information";
|
|
|
|
/// <summary>
|
|
/// Gets or sets the log message.
|
|
/// </summary>
|
|
public string Message { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the UTC timestamp.
|
|
/// </summary>
|
|
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Append-only timeseries metric point used for telemetry sync scenarios.
|
|
/// </summary>
|
|
public class TimeseriesPoint
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the unique metric point identifier.
|
|
/// </summary>
|
|
[Key]
|
|
public string Id { get; set; } = Guid.NewGuid().ToString("N");
|
|
|
|
/// <summary>
|
|
/// Gets or sets the metric name.
|
|
/// </summary>
|
|
public string Metric { get; set; } = "cpu";
|
|
|
|
/// <summary>
|
|
/// Gets or sets the metric value.
|
|
/// </summary>
|
|
public double Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the UTC timestamp.
|
|
/// </summary>
|
|
public DateTime RecordedUtc { get; set; } = DateTime.UtcNow;
|
|
}
|