Skip to content

Commit

Permalink
[Reporting/telemetry] Add 'statuses' object to usage to show status c…
Browse files Browse the repository at this point in the history
…ounts by jobType & appType (elastic#63922)

* [Reporting] Additional status by app data for usage

* --wip-- [skip ci]

* clean up types

* add a prettier-ignore

* fix types

* --wip-- [skip ci]

* fix typo

* more tests

* Tweak the data model

* fix the comments and type keys to reflect the data model

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
tsullivan and elasticmachine committed Apr 27, 2020
1 parent 9932bc6 commit 0da0d81
Show file tree
Hide file tree
Showing 5 changed files with 581 additions and 234 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { uniq } from 'lodash';
import { CSV_JOB_TYPE, PDF_JOB_TYPE, PNG_JOB_TYPE } from '../../common/constants';
import { AvailableTotal, FeatureAvailabilityMap, RangeStats, ExportType } from './types';
import { AvailableTotal, ExportType, FeatureAvailabilityMap, RangeStats } from './types';

function getForFeature(
range: Partial<RangeStats>,
Expand Down Expand Up @@ -47,6 +47,7 @@ export const decorateRangeStats = (
const {
_all: rangeAll,
status: rangeStatus,
statuses: rangeStatusByApp,
[PDF_JOB_TYPE]: rangeStatsPdf,
...rangeStatsBasic
} = rangeStats;
Expand All @@ -73,6 +74,7 @@ export const decorateRangeStats = (
const resultStats = {
_all: rangeAll || 0,
status: { completed: 0, failed: 0, ...rangeStatus },
statuses: rangeStatusByApp,
...rangePdf,
...rangeBasic,
} as RangeStats;
Expand Down
Loading

0 comments on commit 0da0d81

Please sign in to comment.