Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reporting/telemetry] Add 'statuses' object to usage to show status counts by jobType & appType #63922

Merged
Prev Previous commit
Next Next commit
fix the comments and type keys to reflect the data model
tsullivan committed Apr 23, 2020
commit 240b13fac0a92027629172dcc6958d186193c174
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ const PRINTABLE_PDF_JOBTYPE = 'printable_pdf';
const getKeyCount = (buckets: KeyCountBucket[]): { [key: string]: number } =>
buckets.reduce((accum, { key, doc_count: count }) => ({ ...accum, [key]: count }), {});

// indexes some key/count buckets by statusType > appName > jobType: statusCount
// indexes some key/count buckets by statusType > jobType > appName: statusCount
const getAppStatuses = (buckets: StatusByAppBucket[]) =>
buckets.reduce((statuses, statusBucket) => {
return {
4 changes: 2 additions & 2 deletions x-pack/legacy/plugins/reporting/server/usage/types.d.ts
Original file line number Diff line number Diff line change
@@ -79,8 +79,8 @@ interface StatusCounts {

interface StatusByAppCounts {
[statusType: string]: {
[appType: string]: {
[jobType: string]: number;
[jobType: string]: {
[appName: string]: number;
};
};
}