diff --git a/examples/Demo/Program.cs b/examples/Demo/Program.cs index 5eea7ef..e115af9 100644 --- a/examples/Demo/Program.cs +++ b/examples/Demo/Program.cs @@ -43,8 +43,9 @@ public void Run() .LoadInfraConfig("infra-config.json") .WithReportingInterval(TimeSpan.FromSeconds(5)) .WithReportingSinks(_timescaleDbSink) - .WithTestSuite("reporting") + .WithTestSuite("reporting test") .WithTestName("timescale_db_demo") + .WithSessionId("dasfvxcz214141-wfva1-219") .Run(); } } \ No newline at end of file diff --git a/src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs b/src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs index 251aec3..32aaad1 100644 --- a/src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs +++ b/src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs @@ -3,6 +3,7 @@ public static class ColumnNames { public const string Time = "time"; + public const string ScenarioTimestamp = "scenario_timestamp"; public const string SessionId = "session_id"; public const string CurrentOperation = "current_operation"; diff --git a/src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs b/src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs index a9f097a..875567d 100644 --- a/src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs +++ b/src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs @@ -8,6 +8,7 @@ namespace NBomber.Sinks.Timescale.Contracts; public class PointDbRecord { [Column(ColumnNames.Time)] public DateTime Time { get; set; } + [Column(ColumnNames.ScenarioTimestamp)] public TimeSpan ScenarioTimestamp { get; set; } [Column(ColumnNames.SessionId)] public string SessionId { get; set; } [Column(ColumnNames.CurrentOperation)] public OperationType CurrentOperation { get; set; } @@ -59,7 +60,7 @@ public class PointDbRecord [Column(ColumnNames.FailDataP99)] public long FailDataP99 { get; set; } [Column(ColumnNames.FailStatusCodes)] public string FailStatusCodes { get; set; } [Column(ColumnNames.FailLatencyCount)] public string FailLatencyCount { get; set; } - + [Column(ColumnNames.SimulationValue)] public int SimulationValue { get; set; } } diff --git a/src/NBomber.Sinks.Timescale/SqlQueries.cs b/src/NBomber.Sinks.Timescale/SqlQueries.cs index c19e09b..34e98ad 100644 --- a/src/NBomber.Sinks.Timescale/SqlQueries.cs +++ b/src/NBomber.Sinks.Timescale/SqlQueries.cs @@ -13,6 +13,7 @@ public static class SqlQueries CREATE TABLE IF NOT EXISTS ""{StepStatsTable}"" ( ""{ColumnNames.Time}"" TIMESTAMPTZ NOT NULL, + ""{ColumnNames.ScenarioTimestamp}"" TIME WITHOUT TIME ZONE NOT NULL, ""{ColumnNames.SessionId}"" TEXT NOT NULL, ""{ColumnNames.CurrentOperation}"" TEXT, diff --git a/src/NBomber.Sinks.Timescale/TimescaleDbSink.cs b/src/NBomber.Sinks.Timescale/TimescaleDbSink.cs index d820998..50ea5e5 100644 --- a/src/NBomber.Sinks.Timescale/TimescaleDbSink.cs +++ b/src/NBomber.Sinks.Timescale/TimescaleDbSink.cs @@ -170,6 +170,7 @@ private PointDbRecord[] MapToPoint(ScenarioStats scnStats, DateTime currentTime) .Select(step => new PointDbRecord { Time = currentTime, + ScenarioTimestamp = scnStats.Duration, SessionId = testInfo.SessionId, CurrentOperation = nodeInfo.CurrentOperation, Scenario = scnStats.ScenarioName,