MCPcopy Create free account
hub / github.com/aptabase/aptabase / NewSession

Method NewSession

tools/DemoDataGenerator/DemoDataSource.cs:178–188  ·  view source on GitHub ↗
(DateTime startedAt, int maxEventsPerSession)

Source from the content-addressed store, hash-verified

176 };
177
178 public static (string, DateTime[]) NewSession(DateTime startedAt, int maxEventsPerSession)
179 {
180 var eventsCount = _random.Next(2, maxEventsPerSession);
181 var sessionId = Guid.NewGuid().ToString().ToLower();
182
183 var timestamps = Enumerable.Range(0, eventsCount)
184 .Select(i => startedAt.AddSeconds(i * 15).AddSeconds(_random.Next(1, 10)))
185 .ToArray();
186
187 return (sessionId, timestamps);
188 }
189
190 public static int RandomSessionCount() => _random.Next(3, 11);
191

Callers 1

Program.csFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected