Skip to content

Commit

Permalink
remove client discards from totals on orgstats projects (#29079)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshFerge authored Oct 6, 2021
1 parent f46c0e5 commit c8cd66a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions static/app/views/organizationStats/usageStatsProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {t} from 'app/locale';
import {DataCategory, Organization, Project} from 'app/types';
import withProjects from 'app/utils/withProjects';

import {UsageSeries} from './types';
import {Outcome, UsageSeries} from './types';
import UsageTable, {CellProject, CellStat, TableStat} from './usageTable';

type Props = {
Expand Down Expand Up @@ -334,15 +334,17 @@ class UsageStatsProjects extends AsyncComponent<Props, State> {
stats[projectId] = {...baseStat};
}

stats[projectId].total += group.totals['sum(quantity)'];
if (outcome !== Outcome.CLIENT_DISCARD) {
stats[projectId].total += group.totals['sum(quantity)'];
}

if (
outcome === SortBy.ACCEPTED ||
outcome === SortBy.FILTERED ||
outcome === SortBy.DROPPED
) {
if (outcome === Outcome.ACCEPTED || outcome === Outcome.FILTERED) {
stats[projectId][outcome] += group.totals['sum(quantity)'];
} else {
} else if (
outcome === Outcome.RATE_LIMITED ||
outcome === Outcome.INVALID ||
outcome === Outcome.DROPPED
) {
stats[projectId][SortBy.DROPPED] += group.totals['sum(quantity)'];
}
});
Expand Down

0 comments on commit c8cd66a

Please sign in to comment.