isBucketTroubleshootingAllocated method

bool isBucketTroubleshootingAllocated()

Implementation

bool isBucketTroubleshootingAllocated() {
  // Calculate the bucket allocation
  if (_singleton._troubleshooting?.endDate != null) {
    String combinedId = this.visitorId + (_troubleshooting?.endDate ?? "");
    int hashAlloc = (MurmurHash.v3(combinedId, 0) % 100);

    Flagship.logger(Level.INFO,
        "The hash allocation for TR bucket is $hashAlloc ------------");

    int traf = (_troubleshooting?.traffic ?? 0);
    Flagship.logger(Level.INFO,
        "The range allocation for TR bucket is $traf  ------------");

    return (hashAlloc <= (_troubleshooting?.traffic ?? 0));
  } else {
    return false;
  }
}