Search in sources :

Example 6 with CodeBaseEntry2

use of io.codekvast.javaagent.model.v2.CodeBaseEntry2 in project codekvast by crispab.

the class ImportDAOImpl method updateIncompleteMethods.

private void updateIncompleteMethods(long customerId, long publishedAtMillis, Collection<CodeBaseEntry2> entries, Set<String> incompleteMethods, Map<String, Long> existingMethods, Set<Long> incompleteInvocations) {
    long startedAtMillis = System.currentTimeMillis();
    int count = 0;
    for (CodeBaseEntry2 entry : entries) {
        long methodId = existingMethods.get(entry.getSignature());
        if (incompleteMethods.contains(entry.getSignature()) || incompleteInvocations.contains(methodId)) {
            logger.debug("Updating {}", entry.getSignature());
            jdbcTemplate.update(new UpdateIncompleteMethodStatement(customerId, publishedAtMillis, entry));
            count += 1;
        }
    }
    logger.debug("Updated {} incomplete methods in {} ms", count, System.currentTimeMillis() - startedAtMillis);
}
Also used : CodeBaseEntry2(io.codekvast.javaagent.model.v2.CodeBaseEntry2)

Example 7 with CodeBaseEntry2

use of io.codekvast.javaagent.model.v2.CodeBaseEntry2 in project codekvast by crispab.

the class CodeBasePublication2Test method should_transform_from_v1_format.

@SuppressWarnings("deprecation")
@Test
public void should_transform_from_v1_format() {
    CodeBasePublication pub1 = CodeBasePublication.builder().commonData(CommonPublicationData.sampleCommonPublicationData()).entries(Collections.singletonList(CodeBaseEntry.sampleCodeBaseEntry())).overriddenSignatures(Collections.singletonMap("key1", "value1")).strangeSignatures(Collections.singletonMap("key2", "value2")).build();
    CodeBasePublication2 pub2 = CodeBasePublication2.fromV1Format(pub1);
    assertThat(pub2.getCommonData(), is(CommonPublicationData2.sampleCommonPublicationData()));
    assertThat(pub2.getEntries(), hasItems(CodeBaseEntry2.sampleCodeBaseEntry()));
}
Also used : CodeBasePublication2(io.codekvast.javaagent.model.v2.CodeBasePublication2) CodeBasePublication(io.codekvast.javaagent.model.v1.CodeBasePublication) Test(org.junit.Test)

Aggregations

CodeBaseEntry2 (io.codekvast.javaagent.model.v2.CodeBaseEntry2)5 Test (org.junit.Test)4 CodeBasePublication2 (io.codekvast.javaagent.model.v2.CodeBasePublication2)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 CodeBaseEntry (io.codekvast.javaagent.model.v1.CodeBaseEntry)1 CodeBasePublication (io.codekvast.javaagent.model.v1.CodeBasePublication)1 CommonPublicationData2 (io.codekvast.javaagent.model.v2.CommonPublicationData2)1 InvocationDataPublication2 (io.codekvast.javaagent.model.v2.InvocationDataPublication2)1 SignatureStatus2 (io.codekvast.javaagent.model.v2.SignatureStatus2)1 CodeBaseEntry3 (io.codekvast.javaagent.model.v3.CodeBaseEntry3)1 CodeBasePublication3 (io.codekvast.javaagent.model.v3.CodeBasePublication3)1 File (java.io.File)1