Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: remove className from ExecClassData #117

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ slf4jVersion = 1.7.32
logbackVersion= 1.2.12
microutilsLoggingVersion = 2.0.11

sharedLibsRef = main
sharedLibsRef = feature/remove-className-from-execClassAata-EPMDJ-10652
sharedLibsLocalPath = lib-jvm-shared
ptEmulateBigApp = false
nativeAgentLibName = drill-agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class Test2Code(
.map {
ExecClassData(
id = it.id,
className = it.name,
nameId = it.nameId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main purpose of this task is to remove the className, since class is already identified by id.
I don't get why would we want to replace it with a hash value.
Lets discuss it again, I guess.

probes = it.probes.values.toBitSet(),
sessionId = it.sessionId,
testId = it.testId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ open class CoverageManager(
private val probesDescriptorProvider: ProbesDescriptorProvider = ConcurrentProbesDescriptorProvider { descriptor ->
globalExecData[descriptor.id] = ExecDatum(
id = descriptor.id,
name = descriptor.name,
nameId = descriptor.classNameId,
probes = AgentProbes(descriptor.probeCount),
sessionId = GLOBAL_SESSION_ID,
testId = GLOBAL_SESSION_ID
Expand All @@ -47,7 +47,7 @@ open class CoverageManager(
probesDescriptorProvider.fold(ExecData()) { execData, descriptor ->
execData[descriptor.id] = ExecDatum(
id = descriptor.id,
name = descriptor.name,
nameId = descriptor.classNameId,
probes = AgentProbes(descriptor.probeCount),
sessionId = sessionId,
testId = testId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DrillInstrumenter(
override fun instrument(className: String, initialBytes: ByteArray): ByteArray? = try {
val version = InstrSupport.getMajorVersion(initialBytes)
val classId = CRC64.classId(initialBytes)
val nameId = CRC64.classId(className.toByteArray())

//count probes before transformation
val counter = ProbeCounter()
Expand Down Expand Up @@ -65,7 +66,7 @@ class DrillInstrumenter(
probesDescriptorProvider.addDescriptor(
ProbesDescriptor(
id = classId,
name = className,
classNameId = nameId,
probeCount = probeCount
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typealias ExecData = ConcurrentHashMap<ClassId, ExecDatum>
*/
data class ExecDatum(
val id: ClassId,
val name: String,
val nameId: Long,
val probes: AgentProbes,
val sessionId: String,
val testId: String = DEFAULT_TEST_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap
*/
data class ProbesDescriptor(
val id: ClassId,
val name: String,
val classNameId: Long,
val probeCount: Int,
)

Expand Down
Loading