fix(query): anchor=latest follows the newest sample of any level, not just the 1m rows [CI]
This commit is contained in:
1 parent
d95acc6575
commit
e1ec7c9b04
3 files changed
+21
-2
No files matched your search
@@ -90,6 +90,11 @@ public sealed class SqliteMetricStore : IMetricStore
|
||||
c => c.Query($"SELECT MIN(window_start) FROM {level.TableName()} WHERE agent_id = @a AND series = @s", r => r.NullableLong(0), ("@a", agentId.Value), ("@s", series)).FirstOrDefault(),
|
||||
ct);
|
||||
|
||||
public ValueTask<long?> LatestAsync(MetricLevel level, NodeId agentId, string series, CancellationToken ct) =>
|
||||
_db.ReadAsync(
|
||||
c => c.Query($"SELECT MAX(window_start) FROM {level.TableName()} WHERE agent_id = @a AND series = @s", r => r.NullableLong(0), ("@a", agentId.Value), ("@s", series)).FirstOrDefault(),
|
||||
ct);
|
||||
|
||||
public ValueTask<IReadOnlyList<MetricRow>> ReadAgentsAsync(MetricLevel level, IReadOnlyCollection<NodeId> agentIds, string series, long fromMs, long toMs, CancellationToken ct) =>
|
||||
_db.ReadAsync<IReadOnlyList<MetricRow>>(
|
||||
c =>
|
||||
|
||||
Reference in new issue
Block a user