forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] AIOps: Fix incomplete edge buckets for change point detection (e…
…lastic#177579) ## Summary Fixes elastic#170117 Change point embeddable next to the Lens embeddable: <img width="1343" alt="image" src="https://github.com/elastic/kibana/assets/5236598/c9e73688-dd60-4803-a09a-e09f267ee730"> Extends search bounds based on the aggregation interval to complete the edge buckets. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
10 changed files
with
229 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
x-pack/plugins/aiops/public/hooks/__mocks__/use_aiops_app_context.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks'; | ||
import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; | ||
|
||
const staticContext = { | ||
data: dataPluginMock.createStartContract(), | ||
uiSettings: uiSettingsServiceMock.createStartContract(), | ||
}; | ||
|
||
jest.spyOn(staticContext.uiSettings, 'get').mockImplementation((key: string) => { | ||
if (key === 'dateFormat') { | ||
return 'MMM D, YYYY @ HH:mm:ss.SSS'; | ||
} | ||
if (key === 'dateFormat:scaled') { | ||
return [ | ||
['', 'HH:mm:ss.SSS'], | ||
['PT1S', 'HH:mm:ss'], | ||
['PT1M', 'HH:mm'], | ||
['PT1H', 'YYYY-MM-DD HH:mm'], | ||
['P1DT', 'YYYY-MM-DD'], | ||
['P1YT', 'YYYY'], | ||
]; | ||
} | ||
if (key === 'histogram:maxBars') { | ||
return 1000; | ||
} | ||
if (key === 'histogram:barTarget') { | ||
return 50; | ||
} | ||
return ''; | ||
}); | ||
|
||
export const useAiopsAppContext = jest.fn(() => { | ||
return staticContext; | ||
}); |
14 changes: 14 additions & 0 deletions
14
x-pack/plugins/aiops/public/hooks/__mocks__/use_reload.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
const staticMock = { | ||
refreshTimestamp: 1708711043761, | ||
}; | ||
|
||
export const useReload = jest.fn(() => { | ||
return staticMock; | ||
}); |
Oops, something went wrong.