From 108994d4dce736cf43a80aac9bbe10af24c57e9c Mon Sep 17 00:00:00 2001 From: Brenda Sukh Date: Wed, 2 Dec 2020 14:32:40 -0500 Subject: [PATCH] Add additional events panel --- app-config.yaml | 3 + plugins/cost-insights/src/utils/mockData.ts | 90 ++++++++++++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/app-config.yaml b/app-config.yaml index 3b476981e44f0..54d564de7dbf3 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -290,6 +290,9 @@ costInsights: bigQuery: name: BigQuery icon: search + events: + name: Events + icon: data metrics: DAU: name: Daily Active Users diff --git a/plugins/cost-insights/src/utils/mockData.ts b/plugins/cost-insights/src/utils/mockData.ts index 98eab19b41cb6..76bdf5f08f220 100644 --- a/plugins/cost-insights/src/utils/mockData.ts +++ b/plugins/cost-insights/src/utils/mockData.ts @@ -812,7 +812,7 @@ export const SampleComputeEngineInsights: Entity = { id: 'Sample SKU A', aggregation: [1_000, 2_000], change: { - ratio: 0.5, + ratio: 1, amount: 1_000, }, entities: [], @@ -849,6 +849,92 @@ export const SampleComputeEngineInsights: Entity = { ], }; +export const SampleEventsInsights: Entity = { + id: 'events', + aggregation: [20_000, 10_000], + change: { + ratio: -0.5, + amount: -10_000, + }, + entitiesLabel: 'Product', + entities: [ + { + id: 'entity-a', + aggregation: [15_000, 7_000], + change: { + ratio: -0.53333333333, + amount: -8_000, + }, + entities: [ + { + id: 'Sample Product A', + aggregation: [5_000, 2_000], + change: { + ratio: -0.6, + amount: -3_000, + }, + entities: [], + }, + { + id: 'Sample Product B', + aggregation: [7_000, 2_500], + change: { + ratio: -0.64285714285, + amount: -4_500, + }, + entities: [], + }, + { + id: 'Sample Product C', + aggregation: [3_000, 2_500], + change: { + ratio: -0.16666666666, + amount: -500, + }, + entities: [], + }, + ], + }, + { + id: 'entity-b', + aggregation: [5_000, 3_000], + change: { + ratio: -0.4, + amount: -2_000, + }, + entities: [ + { + id: 'Sample Product A', + aggregation: [2_000, 1_000], + change: { + ratio: -0.5, + amount: -1_000, + }, + entities: [], + }, + { + id: 'Sample Product B', + aggregation: [1_000, 1_500], + change: { + ratio: 0.5, + amount: 500, + }, + entities: [], + }, + { + id: 'Sample Product C', + aggregation: [2_000, 500], + change: { + ratio: -0.75, + amount: -1_500, + }, + entities: [], + }, + ], + }, + ], +}; + export function entityOf(product: string): Entity { switch (product) { case 'computeEngine': @@ -859,6 +945,8 @@ export function entityOf(product: string): Entity { return SampleCloudStorageInsights; case 'bigQuery': return SampleBigQueryInsights; + case 'events': + return SampleEventsInsights; default: throw new Error( `Cannot get insights for ${product}. Make sure product matches product property in app-info.yaml`,