mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
281e2fe50c
commit
54c73e2f76
1 changed files with 7 additions and 1 deletions
|
@ -13,6 +13,7 @@ import { opsBuffer } from './ops_buffer';
|
|||
import Oppsy from 'oppsy';
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
let bufferHadEvents = false;
|
||||
|
||||
class OpsMonitor {
|
||||
constructor(server, buffer, interval) {
|
||||
|
@ -80,7 +81,12 @@ export function getOpsStatsCollector(server, kbnServer) {
|
|||
return collectorSet.makeStatsCollector({
|
||||
type: KIBANA_STATS_TYPE_MONITORING,
|
||||
init: opsMonitor.start,
|
||||
isReady: () => buffer.hasEvents(),
|
||||
isReady: () => {
|
||||
if (!bufferHadEvents) {
|
||||
bufferHadEvents = buffer.hasEvents();
|
||||
}
|
||||
return bufferHadEvents;
|
||||
},
|
||||
fetch: async () => {
|
||||
return await buffer.flush();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue