Countly/countly-server

countly-browser可以帮我解释一下shardname 产生的使用的什么规则吗

jikuanyu opened this issue · 1 comments

Expected Behavior

我看了一下表结构:
https://support.count.ly/hc/en-us/articles/360037681892-countly-browser

There are 4 types of documents available:

Zero document, which id is formed from {appID}{year}:0 And it contains stats breakdown by months and weeks for the specified year
Month document, which id is formed from {appID}
{year}:{month} And it contains stats breakdown by days of the month
Splitted zero document which id is formed from {appID}{year}:0{shardname}
Splitted month document which id is formed from {appID}{year}:{month}{shardname}

可以帮我解释一下shardname 产生的使用的什么规则吗

Current Behavior

Screenshots (if appropriate):

Possible Solution

Steps to Reproduce (for bugs)

More Description

Your Environment

  • Operating System and version:
  • Any changes you have made to your instance:

Hello
We take the value of the browser, like Chrome, and do a base64 encode, and take the first letter of the result.
That way there are possible 64 shards, and the same browser value will always land in the say document for consistency

postfix = common.crypto.createHash("md5").update(recvMetricValue).digest('base64')[0];

Hope that helps :)