Change query metric hash from MD5 of sql + name + loc to Checksum of sql

This commit is contained in:
rbygrave
2021-08-06 11:52:38 +12:00
parent f34e0f5f2b
commit 7ca72a39b1
14 changed files with 36 additions and 108 deletions
@@ -1,18 +0,0 @@
package io.ebeaninternal.server.util;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class Md5Test {
@Test
public void hash() throws Exception {
String content = "some random content we wish to hash";
String hash1 = Md5.hash(content);
String hash2 = Md5.hash(content);
assertEquals(hash1, hash2);
}
}
@@ -244,7 +244,7 @@ public class TestCustomerFinder extends BaseTestCase {
assertThat(metricsJson).contains("\"name\":\"orm.Customer.findList\"");
assertThat(metricsJson).contains("\"loc\":\"CustomerFinder.byNameStatus(CustomerFinder.java:44)\"");
if (isH2() || isPostgres()) {
assertThat(metricsJson).contains("\"hash\":\"cc20eb930403cfd418db2d0475c6e26a\"");
assertThat(metricsJson).contains("\"hash\":3634991469");
assertThat(metricsJson).contains("\"sql\":\"select t0.id, t0.status,");
}
}