stabilizaiton work - projects rework for maintenanceability and ui livening
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace StellaOps.Provcache;
|
||||
|
||||
public sealed partial class ProvcacheOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Compute time window epoch from a timestamp based on the configured bucket size.
|
||||
/// </summary>
|
||||
/// <param name="timestamp">The timestamp to compute the epoch for.</param>
|
||||
/// <returns>The epoch identifier string.</returns>
|
||||
public string ComputeTimeWindow(DateTimeOffset timestamp)
|
||||
{
|
||||
var bucketTicks = TimeWindowBucket.Ticks;
|
||||
var epoch = timestamp.UtcTicks / bucketTicks * bucketTicks;
|
||||
return new DateTimeOffset(epoch, TimeSpan.Zero).ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user