@Test public void calculateBucketStatisticsTest() { Map<Bucket.Label, BucketCounts> buckets = new HashMap<Bucket.Label, BucketCounts>(); buckets.put(Bucket.Label.valueOf("Test"), new BucketCounts.Builder().build()); BinomialMetrics.BinomialMetric binomialMetric = mock(BinomialMetrics.BinomialMetric.class); Map<Bucket.Label, BucketStatistics> result = this.analyticsImpl.calculateBucketStatistics(buckets, binomialMetric, 1.0, Parameters.Mode.TEST); assertThat(result.size(), is(1)); }
Map<Bucket.Label, BucketStatistics> calculateBucketStatistics(Map<Bucket.Label, BucketCounts> buckets, BinomialMetric metric, double effectSize, Parameters.Mode mode) { Map<Bucket.Label, BucketStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : buckets.values()) { Bucket.Label bucketLabel = bucket.getLabel(); BucketStatistics bucketWithStats = new BucketStatistics.Builder() .withBucketCounts(bucket) .withBucketComparisons(new HashMap<Bucket.Label, BucketComparison>()) .build(); analysisTools.generateRate(bucketWithStats, metric); bucketsWithStats.put(bucketLabel, bucketWithStats); } analysisTools.generateBucketComparison(bucketsWithStats, metric, effectSize, mode); return bucketsWithStats; }
AnalyticsImpl implements Analytics { Map<Bucket.Label, BucketStatistics> calculateBucketStatistics(Map<Bucket.Label, BucketCounts> buckets, BinomialMetric metric, double effectSize, Parameters.Mode mode) { Map<Bucket.Label, BucketStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : buckets.values()) { Bucket.Label bucketLabel = bucket.getLabel(); BucketStatistics bucketWithStats = new BucketStatistics.Builder() .withBucketCounts(bucket) .withBucketComparisons(new HashMap<Bucket.Label, BucketComparison>()) .build(); analysisTools.generateRate(bucketWithStats, metric); bucketsWithStats.put(bucketLabel, bucketWithStats); } analysisTools.generateBucketComparison(bucketsWithStats, metric, effectSize, mode); return bucketsWithStats; } }
AnalyticsImpl implements Analytics { Map<Bucket.Label, BucketStatistics> calculateBucketStatistics(Map<Bucket.Label, BucketCounts> buckets, BinomialMetric metric, double effectSize, Parameters.Mode mode) { Map<Bucket.Label, BucketStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : buckets.values()) { Bucket.Label bucketLabel = bucket.getLabel(); BucketStatistics bucketWithStats = new BucketStatistics.Builder() .withBucketCounts(bucket) .withBucketComparisons(new HashMap<Bucket.Label, BucketComparison>()) .build(); analysisTools.generateRate(bucketWithStats, metric); bucketsWithStats.put(bucketLabel, bucketWithStats); } analysisTools.generateBucketComparison(bucketsWithStats, metric, effectSize, mode); return bucketsWithStats; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); }
AnalyticsImpl implements Analytics { Map<Bucket.Label, BucketStatistics> calculateBucketStatistics(Map<Bucket.Label, BucketCounts> buckets, BinomialMetric metric, double effectSize, Parameters.Mode mode) { Map<Bucket.Label, BucketStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : buckets.values()) { Bucket.Label bucketLabel = bucket.getLabel(); BucketStatistics bucketWithStats = new BucketStatistics.Builder() .withBucketCounts(bucket) .withBucketComparisons(new HashMap<Bucket.Label, BucketComparison>()) .build(); analysisTools.generateRate(bucketWithStats, metric); bucketsWithStats.put(bucketLabel, bucketWithStats); } analysisTools.generateBucketComparison(bucketsWithStats, metric, effectSize, mode); return bucketsWithStats; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); @Override ExperimentCounts getExperimentRollup(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCounts getExperimentCounts(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentRollupDailies(final Experiment.ID experimentID,
                                                                 final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentCountsDailies(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentStatistics getExperimentStatistics(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentCumulativeStatistics getExperimentStatisticsDailies(final Experiment.ID experimentId,
                                                                         final Parameters parameters); @Override AssignmentCounts getAssignmentCounts(Experiment.ID experimentID, Context context); }
AnalyticsImpl implements Analytics { Map<Bucket.Label, BucketStatistics> calculateBucketStatistics(Map<Bucket.Label, BucketCounts> buckets, BinomialMetric metric, double effectSize, Parameters.Mode mode) { Map<Bucket.Label, BucketStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : buckets.values()) { Bucket.Label bucketLabel = bucket.getLabel(); BucketStatistics bucketWithStats = new BucketStatistics.Builder() .withBucketCounts(bucket) .withBucketComparisons(new HashMap<Bucket.Label, BucketComparison>()) .build(); analysisTools.generateRate(bucketWithStats, metric); bucketsWithStats.put(bucketLabel, bucketWithStats); } analysisTools.generateBucketComparison(bucketsWithStats, metric, effectSize, mode); return bucketsWithStats; } @Inject  AnalyticsImpl(final Experiments experiments, final AssignmentsRepository assignmentRepository,
                         final TransactionFactory dataTransactorFactory, final AnalyticsRepository analyticsRepository,
                         final AnalysisTools analysisTools,
                         final @CassandraRepository ExperimentRepository cassandraRepository); @Override ExperimentCounts getExperimentRollup(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCounts getExperimentCounts(final Experiment.ID experimentID, final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentRollupDailies(final Experiment.ID experimentID,
                                                                 final Parameters parameters); @Override ExperimentCumulativeCounts getExperimentCountsDailies(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentStatistics getExperimentStatistics(final Experiment.ID experimentId, final Parameters parameters); @Override ExperimentCumulativeStatistics getExperimentStatisticsDailies(final Experiment.ID experimentId,
                                                                         final Parameters parameters); @Override AssignmentCounts getAssignmentCounts(Experiment.ID experimentID, Context context); static final String PROPERTY_NAME; }