Skip to content

Commit

Permalink
Metrics from 2.1.4 correctly counted
Browse files Browse the repository at this point in the history
  • Loading branch information
mjadach-iv committed Aug 12, 2024
1 parent 8f5de1d commit 0ed08e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hopr-admin",
"version": "2.1.3",
"version": "2.1.4",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.0",
Expand Down
3 changes: 1 addition & 2 deletions src/store/slices/node/actionsAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,8 @@ const getConfigurationThunk = createAsyncThunk<
'node/getConfiguration',
async (payload, { rejectWithValue, dispatch }) => {
try {
console.log('getConfigurationThunk start');
const configuration = await getConfiguration(payload);
console.log('getConfigurationThunk', configuration);
console.log('Configuration:\n', configuration);
return configuration;
} catch (e) {
if (e instanceof sdkApiError) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const parseMetrics = (data: string) => {
parsed[key].type = type;
} else {
const parsedData = parseFloat(string[1]);
if (parsedData) parsed[lastKey].data.push(parsedData);
if (parsedData || parsedData === 0) parsed[lastKey].data.push(parsedData);
const category = string[0].replace(lastKey, '');
if (category[0] === '_') category.replace('_', '');
parsed[lastKey].categories.push(category);
parsed[lastKey].length++;
}
}

console.log(parsed);
console.log('Metrics:', parsed);
return parsed;
};

0 comments on commit 0ed08e3

Please sign in to comment.