-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from AlexanderWert/mobile-exploratory-view
- Loading branch information
Showing
10 changed files
with
138 additions
and
61 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
51 changes: 51 additions & 0 deletions
51
...ic/components/shared/exploratory_view/configurations/mobile/device_distribution_config.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,51 @@ | ||
/* | ||
* 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 { ConfigProps, DataSeries } from '../../types'; | ||
import { FieldLabels, USE_BREAK_DOWN_COLUMN } from '../constants'; | ||
import { buildPhraseFilter } from '../utils'; | ||
import { | ||
SERVICE_NAME, | ||
} from '../constants/elasticsearch_fieldnames'; | ||
import { MOBILE_APP, NUMBER_OF_DEVICES } from '../constants/labels'; | ||
import { MobileFields } from './mobile_fields'; | ||
|
||
export function getMobileDeviceDistributionConfig({ indexPattern }: ConfigProps): DataSeries { | ||
return { | ||
reportType: 'mobile-device-distribution', | ||
defaultSeriesType: 'bar', | ||
seriesTypes: ['bar', 'bar_horizontal' ], | ||
xAxisColumn: { | ||
sourceField: USE_BREAK_DOWN_COLUMN, | ||
}, | ||
yAxisColumns: [ | ||
{ | ||
sourceField: 'labels.device_id', | ||
operationType: 'unique_count', | ||
label: NUMBER_OF_DEVICES, | ||
}, | ||
], | ||
hasOperationType: false, | ||
defaultFilters: Object.keys(MobileFields), | ||
breakdowns: Object.keys(MobileFields), | ||
filters: [ | ||
...buildPhraseFilter('agent.name', 'iOS/swift', indexPattern), | ||
...buildPhraseFilter('processor.event', 'transaction', indexPattern), | ||
], | ||
labels: { | ||
...FieldLabels, | ||
...MobileFields, | ||
[SERVICE_NAME]: MOBILE_APP, | ||
}, | ||
reportDefinitions: [ | ||
{ | ||
field: SERVICE_NAME, | ||
required: true, | ||
}, | ||
], | ||
}; | ||
} |
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
19 changes: 19 additions & 0 deletions
19
...vability/public/components/shared/exploratory_view/configurations/mobile/mobile_fields.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,19 @@ | ||
import { | ||
CARRIER_LOCATION, | ||
CARRIER_NAME, | ||
CONNECTION_TYPE, | ||
DEVICE_MODEL, | ||
HOST_OS, | ||
OS_PLATFORM, | ||
SERVICE_VERSION, | ||
} from '../constants/labels'; | ||
|
||
export const MobileFields : Record<string, string> = { | ||
'host.os.platform': OS_PLATFORM, | ||
'host.os.full': HOST_OS, | ||
'service.version': SERVICE_VERSION, | ||
'network.carrier.icc': CARRIER_LOCATION, | ||
'network.carrier.name': CARRIER_NAME, | ||
'network.connection_type': CONNECTION_TYPE, | ||
'labels.device_model': DEVICE_MODEL, | ||
}; |
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
Oops, something went wrong.