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 <ananzh@amazon.com>
  • Loading branch information
ananzh authored Mar 2, 2022
1 parent 0c27123 commit d7661ae
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 d7661ae

Please sign in to comment.