Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTimeOffset replaced by DateTime #5

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/TimescaleBenchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void Run()
connection.ExecuteNonQuery(SqlQueries.CreateStepStatsTable + SqlQueries.CreateClusterStatsTable);

var writeScenario = new WriteScenario().Create(connectionString);
var readScenario = new ReadScenario().Create(connectionString, DateTimeOffset.UtcNow, sessionId: "0");
var readScenario = new ReadScenario().Create(connectionString, DateTime.UtcNow, sessionId: "0");

NBomberRunner
.RegisterScenarios(writeScenario)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/TimescaleBenchmark/ReadScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace TimescaleBenchmark;

public class ReadScenario
{
public ScenarioProps Create(string connectionString, DateTimeOffset startTime, string sessionId)
public ScenarioProps Create(string connectionString, DateTime startTime, string sessionId)
{
return Scenario.Create("read_scenario", async ctx =>
{
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/TimescaleBenchmark/WriteScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ScenarioProps Create(string connectionString)
{
await using var connection = new NpgsqlConnection(connectionString);

var curTime = DateTimeOffset.UtcNow;
var curTime = DateTime.UtcNow;

fakePoint.Time = curTime;
fakePoint.SessionId = ctx.ScenarioInfo.InstanceNumber.ToString();
Expand Down
4 changes: 2 additions & 2 deletions src/NBomber.Sinks.Timescale/Contracts/PointDbRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace NBomber.Sinks.Timescale.Contracts;

public class PointDbRecord
{
[Column(ColumnNames.Time)] public DateTimeOffset Time { get; set; }
[Column(ColumnNames.Time)] public DateTime Time { get; set; }
[Column(ColumnNames.SessionId)] public string SessionId { get; set; }
[Column(ColumnNames.CurrentOperation)] public OperationType CurrentOperation { get; set; }

Expand Down Expand Up @@ -66,7 +66,7 @@ public class PointDbRecord

public class NodeInfoDbRecord
{
[Column(ColumnNames.Time)] public DateTimeOffset Time { get; set; }
[Column(ColumnNames.Time)] public DateTime Time { get; set; }
[Column(ColumnNames.SessionId)] public string SessionId { get; set; }
[Column(ColumnNames.NodeInfo)] public string NodeInfo { get; set; }
}
6 changes: 3 additions & 3 deletions src/NBomber.Sinks.Timescale/TimescaleDbSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public async Task Start()

var record = new NodeInfoDbRecord
{
Time = DateTimeOffset.UtcNow,
Time = DateTime.UtcNow,
SessionId = _context.TestInfo.SessionId,
NodeInfo = Json.serialize(nodeInfo)
};
Expand All @@ -101,7 +101,7 @@ private async Task SaveScenarioStats(ScenarioStats[] stats)
{
if (_mainConnection != null)
{
var currentTime = DateTimeOffset.UtcNow;
var currentTime = DateTime.UtcNow;

var points = stats.Select(AddGlobalInfoStep)
.SelectMany(step => MapToPoint(step, currentTime))
Expand All @@ -119,7 +119,7 @@ private ScenarioStats AddGlobalInfoStep(ScenarioStats scnStats)
return scnStats;
}

private PointDbRecord[] MapToPoint(ScenarioStats scnStats, DateTimeOffset currentTime)
private PointDbRecord[] MapToPoint(ScenarioStats scnStats, DateTime currentTime)
{
var nodeInfo = _context.GetNodeInfo();
var testInfo = _context.TestInfo;
Expand Down
Loading