Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public long getCount() {
}

@VisibleForTesting
TDigest tDigest() {
return distRef.get();
synchronized int getDigestHashCode() {
return distRef.get().hashCode();
}

private TDigest create() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.spotify.metrics.core;

import com.tdunning.math.stats.TDigest;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -33,11 +32,11 @@ public void testRecord(){
@Test
public void testGetValueAndFlush(){
Arrays.stream(period1Data).forEach(t->distribution.record(t));
TDigest periode1tDigest = distribution.tDigest();
int periode1tDigest = distribution.getDigestHashCode();
distribution.getValueAndFlush();
Arrays.stream(period1Data).forEach(t->distribution.record(t) );
assertEquals(period1Data.length, distribution.getCount());
TDigest periode2Digest = distribution.tDigest();
int periode2Digest = distribution.getDigestHashCode();
assertNotEquals(periode1tDigest,periode2Digest);
}

Expand Down