Skip to content

Commit 85dbd53

Browse files
authored
feat, fix: prettify Unimind negative percentage; fix percentiles bucketed by hour (#591)
1 parent 5af071d commit 85dbd53

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

bin/stacks/dashboard-stack.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,12 @@ export class DashboardStack extends cdk.NestedStack {
616616
properties: {
617617
region,
618618
title: 'Percentage of Orders with Negative π',
619-
view: 'timeSeries',
619+
view: 'table',
620620
query:
621621
`SOURCE '/aws/lambda/${getUnimindLambdaName}'
622622
| filter eventType = "UnimindPiCalculated"
623-
| fields @timestamp, pi <= 0 as isNegative, pi > 0 as isPositive
624-
| stats sum(isNegative) as negative, sum(isPositive) as positive by bin(5m)
625-
| fields bin as @timestamp, (negative / (negative + positive)) * 100 as negativePiPercentage`
623+
| stats sum(pi <= 0) as negCount, count(*) as totalCount by bin(1d)
624+
| fields (negCount/totalCount)*100 as negativePiPercentage`,
626625
}
627626
},
628627
{
@@ -634,12 +633,12 @@ export class DashboardStack extends cdk.NestedStack {
634633
properties: {
635634
metrics: [
636635
['Uniswap', 'UnimindPiValue', 'Service', 'UniswapXService', { stat: 'Minimum', label: 'Min' }],
637-
['.', '.', '.', '.', { stat: 'p10', label: 'p10' }],
638-
['.', '.', '.', '.', { stat: 'p25', label: 'p25' }],
639-
['.', '.', '.', '.', { stat: 'p50', label: 'p50 (median)' }],
640-
['.', '.', '.', '.', { stat: 'p75', label: 'p75' }],
641-
['.', '.', '.', '.', { stat: 'p90', label: 'p90' }],
642-
['.', '.', '.', '.', { stat: 'p99', label: 'p99' }],
636+
['.', '.', '.', '.', { stat: 'p10.0', label: 'p10' }],
637+
['.', '.', '.', '.', { stat: 'p25.0', label: 'p25' }],
638+
['.', '.', '.', '.', { stat: 'p50.0', label: 'p50 (median)' }],
639+
['.', '.', '.', '.', { stat: 'p75.0', label: 'p75' }],
640+
['.', '.', '.', '.', { stat: 'p90.0', label: 'p90' }],
641+
['.', '.', '.', '.', { stat: 'p99.0', label: 'p99' }],
643642
['.', '.', '.', '.', { stat: 'Maximum', label: 'Max' }],
644643
['.', '.', '.', '.', { stat: 'Average', label: 'Average' }],
645644
['.', '.', '.', '.', { stat: 'SampleCount', label: 'Count', visible: false }],

0 commit comments

Comments
 (0)