mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Logstash Centralized Management] Hide recently-deleted pipelines (follow up PR) (#18683)
* Renaming constant to be more descriptive * Less kludgy language for better readabilility * Removing extraneous newlines
This commit is contained in:
parent
65c907834c
commit
b378717c86
3 changed files with 4 additions and 6 deletions
|
@ -11,5 +11,5 @@ export const MONITORING = {
|
|||
* also, deliberately, the same duration we give Monitoring to pick up and report on a recently-deleted pipeline before we
|
||||
* are safe to stop tracking that pipeline as recently-deleted.
|
||||
*/
|
||||
PIPELINE_RECENCY_DURATION_S: 30
|
||||
ACTIVE_PIPELINE_RANGE_S: 30
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@ export class MonitoringService {
|
|||
const body = {
|
||||
timeRange: {
|
||||
max: now.toISOString(),
|
||||
min: now.subtract(MONITORING.PIPELINE_RECENCY_DURATION_S, 'seconds').toISOString()
|
||||
min: now.subtract(MONITORING.ACTIVE_PIPELINE_RANGE_S, 'seconds').toISOString()
|
||||
}
|
||||
};
|
||||
return this.$http.post(url, body);
|
||||
|
|
|
@ -32,13 +32,13 @@ export class PipelinesService {
|
|||
|
||||
// Monitoring will report centrally-managed pipelines as well, including recently-deleted centrally-managed ones.
|
||||
// If there's a recently-deleted pipeline we're keeping track of BUT monitoring doesn't report it, that means
|
||||
// it's no longer actually running in Logstash any more. So we can stop tracking it as a recently-deleted pipeline.
|
||||
// it's not running in Logstash any more. So we can stop tracking it as a recently-deleted pipeline.
|
||||
const monitoringPipelineIds = monitoringPipelines.map(pipeline => pipeline.id);
|
||||
this.getRecentlyDeleted().forEach(recentlyDeletedPipeline => {
|
||||
// We don't want to stop tracking the recently-deleted pipeline until Monitoring has had some
|
||||
// time to report on it. Otherwise, if we stop tracking first, *then* Monitoring reports it, we'll
|
||||
// still end up showing it in the list until Monitoring stops reporting it.
|
||||
if (now - recentlyDeletedPipeline.deletedOn < (MONITORING.PIPELINE_RECENCY_DURATION_S * 1000)) {
|
||||
if (now - recentlyDeletedPipeline.deletedOn < (MONITORING.ACTIVE_PIPELINE_RANGE_S * 1000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -127,11 +127,9 @@ export class PipelinesService {
|
|||
}
|
||||
|
||||
return JSON.parse(recentlyDeletedPipelines);
|
||||
|
||||
}
|
||||
|
||||
setRecentlyDeleted(recentlyDeletedPipelineIds) {
|
||||
this.$window.localStorage.setItem(RECENTLY_DELETED_PIPELINE_IDS_STORAGE_KEY, JSON.stringify(recentlyDeletedPipelineIds));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue