mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudWatch Logs: Change what we use to measure progress (#28912)
This commit is contained in:
parent
f22d77100f
commit
76f4c11430
@ -336,7 +336,7 @@ export class CloudWatchDatasource extends DataSourceApi<CloudWatchQuery, CloudWa
|
||||
({ failures, prevRecordsMatched }, frames) => {
|
||||
failures++;
|
||||
for (const frame of frames) {
|
||||
const recordsMatched = frame.meta?.stats?.find(stat => stat.displayName === 'Records matched')?.value!;
|
||||
const recordsMatched = frame.meta?.stats?.find(stat => stat.displayName === 'Records scanned')?.value!;
|
||||
if (recordsMatched > (prevRecordsMatched[frame.refId!] ?? 0)) {
|
||||
failures = 0;
|
||||
}
|
||||
|
@ -186,23 +186,23 @@ describe('CloudWatchDatasource', () => {
|
||||
|
||||
it('should stop querying when no more data received a number of times in a row', async () => {
|
||||
const fakeFrames = genMockFrames(20);
|
||||
const initialRecordsMatched = fakeFrames[0].meta!.stats!.find(stat => stat.displayName === 'Records matched')!
|
||||
const initialRecordsMatched = fakeFrames[0].meta!.stats!.find(stat => stat.displayName === 'Records scanned')!
|
||||
.value!;
|
||||
for (let i = 1; i < 4; i++) {
|
||||
fakeFrames[i].meta!.stats = [
|
||||
{
|
||||
displayName: 'Records matched',
|
||||
displayName: 'Records scanned',
|
||||
value: initialRecordsMatched,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
const finalRecordsMatched = fakeFrames[9].meta!.stats!.find(stat => stat.displayName === 'Records matched')!
|
||||
const finalRecordsMatched = fakeFrames[9].meta!.stats!.find(stat => stat.displayName === 'Records scanned')!
|
||||
.value!;
|
||||
for (let i = 10; i < fakeFrames.length; i++) {
|
||||
fakeFrames[i].meta!.stats = [
|
||||
{
|
||||
displayName: 'Records matched',
|
||||
displayName: 'Records scanned',
|
||||
value: finalRecordsMatched,
|
||||
},
|
||||
];
|
||||
@ -1198,7 +1198,7 @@ function genMockFrames(numResponses: number): DataFrame[] {
|
||||
},
|
||||
stats: [
|
||||
{
|
||||
displayName: 'Records matched',
|
||||
displayName: 'Records scanned',
|
||||
value: (i + 1) * recordIncrement,
|
||||
},
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user