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.
Support Histogram Data Type (elastic#59387)
Added the histogram field type to Kibana, to be used in the percentiles, percentiles ranks, and median aggregations.
- Loading branch information
1 parent
afe00a0
commit 8499dac
Showing
19 changed files
with
321 additions
and
4 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
4 changes: 4 additions & 0 deletions
4
src/legacy/ui/public/field_editor/__snapshots__/field_editor.test.js.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
60 changes: 60 additions & 0 deletions
60
x-pack/test/functional/apps/visualize/precalculated_histogram.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,60 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function({ getService, getPageObjects }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const PageObjects = getPageObjects(['common', 'visualize', 'discover', 'visChart', 'visEditor']); | ||
const kibanaServer = getService('kibanaServer'); | ||
const log = getService('log'); | ||
|
||
describe('pre_calculated_histogram', function() { | ||
before(async function() { | ||
log.debug('Starting pre_calculated_histogram before method'); | ||
await esArchiver.load('pre_calculated_histogram'); | ||
await kibanaServer.uiSettings.replace({ defaultIndex: 'test-histogram' }); | ||
}); | ||
|
||
after(function() { | ||
return esArchiver.unload('pre_calculated_histogram'); | ||
}); | ||
|
||
const initHistogramBarChart = async () => { | ||
await PageObjects.visualize.navigateToNewVisualization(); | ||
await PageObjects.visualize.clickVerticalBarChart(); | ||
await PageObjects.visualize.clickNewSearch('histogram-test'); | ||
await PageObjects.visChart.waitForVisualization(); | ||
}; | ||
|
||
const getFieldOptionsForAggregation = async (aggregation: string): Promise<string[]> => { | ||
await PageObjects.visEditor.clickBucket('Y-axis', 'metrics'); | ||
await PageObjects.visEditor.selectAggregation(aggregation, 'metrics'); | ||
const fieldValues = await PageObjects.visEditor.getField(); | ||
return fieldValues; | ||
}; | ||
|
||
it('appears correctly in discover', async function() { | ||
await PageObjects.common.navigateToApp('discover'); | ||
const rowData = await PageObjects.discover.getDocTableIndex(1); | ||
expect(rowData.includes('"values": [ 0.3, 1, 3, 4.2, 4.8 ]')).to.be.ok(); | ||
}); | ||
|
||
it('appears in the field options of a Percentiles aggregation', async function() { | ||
await initHistogramBarChart(); | ||
const fieldValues: string[] = await getFieldOptionsForAggregation('Percentiles'); | ||
log.debug('Percentiles Fields = ' + fieldValues); | ||
expect(fieldValues[0]).to.be('histogram-content'); | ||
}); | ||
|
||
it('appears in the field options of a Percentile Ranks aggregation', async function() { | ||
const fieldValues: string[] = await getFieldOptionsForAggregation('Percentile Ranks'); | ||
log.debug('Percentile Ranks Fields = ' + fieldValues); | ||
expect(fieldValues[0]).to.be('histogram-content'); | ||
}); | ||
}); | ||
} |
Oops, something went wrong.