Skip to content

Commit

Permalink
[nodejs client] fix hookup issues in src/core/server/core_usage_data_…
Browse files Browse the repository at this point in the history
…service.ts (#1225)

Fix issues in src/core/server/core_usage_data_service.ts.
Change types of property docsCount,docsDeleted,storeSizeBytes
and primaryStoreSizeBytes from 'string | undefined to 'number'.

Issue Resolved: #1224
Partical Resolved: #837

Signed-off-by: Anan Zhuang <[email protected]>
  • Loading branch information
ananzh committed Mar 5, 2022
1 parent c56f149 commit 6adff9c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/server/core_usage_data/core_usage_data_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ export class CoreUsageDataService implements CoreService<void, CoreUsageDataStar
index,
this.opensearchDashboardsConfig!.index
),
docsCount: stats['docs.count'],
docsDeleted: stats['docs.deleted'],
storeSizeBytes: stats['store.size'],
primaryStoreSizeBytes: stats['pri.store.size'],
docsCount: stats['docs.count'] ? parseInt(stats['docs.count'], 10) : 0,
docsDeleted: stats['docs.deleted'] ? parseInt(stats['docs.deleted'], 10) : 0,
storeSizeBytes: stats['store.size'] ? parseInt(stats['store.size'], 10) : 0,
primaryStoreSizeBytes: stats['pri.store.size']
? parseInt(stats['pri.store.size'], 10)
: 0,
};
});
})
Expand Down

0 comments on commit 6adff9c

Please sign in to comment.