Skip to content

Commit ad7856b

Browse files
committed
Remove debuging code and add dimensions to scope
1 parent fa3df38 commit ad7856b

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

src/shared/hooks/useGetChartData.ts

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ export const useGetChartData = async ({
3333
to,
3434
...rest
3535
}: UseGetChartDataType) => {
36-
console.log({
37-
baseUrl,
38-
roomId,
39-
nodes,
40-
spaceId,
41-
contextId,
42-
filterBy,
43-
filterValue,
44-
groupBy,
45-
method,
46-
group,
47-
dimensions,
48-
from,
49-
to,
50-
...rest,
51-
});
5236
let metrics = [];
5337

5438
switch (groupBy) {
@@ -65,10 +49,6 @@ export const useGetChartData = async ({
6549
aggregation: method,
6650
},
6751
];
68-
// metrics = [
69-
// { method: 'sum', groupBy: ['chart', 'node'] },
70-
// { method, groupBy: ['node'] },
71-
// ];
7252
break;
7353
case 'dimension':
7454
metrics = [
@@ -78,7 +58,6 @@ export const useGetChartData = async ({
7858
aggregation: method,
7959
},
8060
];
81-
// metrics = [{ method, groupBy: ['dimension'] }];
8261
break;
8362
case 'instance':
8463
metrics = [
@@ -88,7 +67,6 @@ export const useGetChartData = async ({
8867
aggregation: 'sum',
8968
},
9069
];
91-
// metrics = [{ method: 'sum', groupBy: ['chart', 'node'] }];
9270
break;
9371
default:
9472
metrics = [
@@ -103,10 +81,6 @@ export const useGetChartData = async ({
10381
aggregation: 'avg',
10482
},
10583
];
106-
// metrics = [
107-
// { method: 'sum', groupBy: ['chart', `label=${groupBy}`] },
108-
// { method: 'avg', groupBy: [`label=${groupBy}`] },
109-
// ];
11084
break;
11185
}
11286

@@ -119,6 +93,7 @@ export const useGetChartData = async ({
11993
scope: {
12094
contexts: [contextId],
12195
nodes,
96+
dimensions,
12297
},
12398
selectors: {
12499
contexts: ['*'],
@@ -134,26 +109,4 @@ export const useGetChartData = async ({
134109
window: { after: from, before: to, points: 269 },
135110
},
136111
});
137-
138-
// return await Post({
139-
// path: `/v3/spaces/${spaceId}/rooms/${roomId}/data`,
140-
// baseUrl,
141-
// data: {
142-
// filter: {
143-
// nodeIDs: nodes,
144-
// context: contextId,
145-
// dimensions,
146-
// ...(filterBy && filterValue ? { labels: { [filterBy]: [filterValue] } } : {}),
147-
// },
148-
// aggregations,
149-
// agent_options: ['jsonwrap', 'flip', 'ms'],
150-
// points: 335,
151-
// format: 'json',
152-
// group,
153-
// gtime: 0,
154-
// after: from,
155-
// before: to,
156-
// with_metadata: true,
157-
// },
158-
// });
159112
};

0 commit comments

Comments
 (0)