Skip to content

Commit

Permalink
Add additional events panel
Browse files Browse the repository at this point in the history
  • Loading branch information
brendasukh committed Dec 2, 2020
1 parent ff83308 commit 108994d
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ costInsights:
bigQuery:
name: BigQuery
icon: search
events:
name: Events
icon: data
metrics:
DAU:
name: Daily Active Users
Expand Down
90 changes: 89 additions & 1 deletion plugins/cost-insights/src/utils/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down Expand Up @@ -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':
Expand All @@ -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`,
Expand Down

0 comments on commit 108994d

Please sign in to comment.