Skip to content

Commit

Permalink
Merge pull request #12 from PragmaticFlow/11-add-new-column-scenariot…
Browse files Browse the repository at this point in the history
…imestamp

added new column scenarion timestamp
  • Loading branch information
OlenaKostash authored Aug 22, 2024
2 parents 5c4ec66 + 2db49c1 commit 149ce12
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion examples/Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
1 change: 1 addition & 0 deletions src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public static class ColumnNames

Check warning on line 3 in src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ColumnNames'
{
public const string Time = "time";

Check warning on line 5 in src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ColumnNames.Time'
public const string ScenarioTimestamp = "scenario_timestamp";

Check warning on line 6 in src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ColumnNames.ScenarioTimestamp'
public const string SessionId = "session_id";

Check warning on line 7 in src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ColumnNames.SessionId'
public const string CurrentOperation = "current_operation";

Check warning on line 8 in src/NBomber.Sinks.Timescale/Contracts/ColumnNames.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ColumnNames.CurrentOperation'

Expand Down
3 changes: 2 additions & 1 deletion src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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; }
}

Expand Down
1 change: 1 addition & 0 deletions src/NBomber.Sinks.Timescale/SqlQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/NBomber.Sinks.Timescale/TimescaleDbSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 149ce12

Please sign in to comment.