Skip to content

[Admin Analytics] update stat items data types to float

Warren Gifford requested to merge naman/update-admin-analytics-data-types into main

Created by: thenamankumar

Graphql Int type only interfaces with int32 in go. For large-scale sg instances, the counts for some stat items can be > 2^32.

The BigInt data type in Graphql works with int64 in go but returns count as a string which has to be always typecasted to Number before operating on in JS.

The better solution is to use Float in graphql and float64 in go which will handle numbers up to 2^64 easily.

This PR converts all the admin analytics stat items data types from Int to Float in graphql and from int32 to float64 in go.

Test plan

  • Enable feature flag: admin-analytics-enabled
  • Go to /site-admin/analytics/users and check if the stats are loading.

Merge request reports

Loading