Skip to content
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 @@ -1202,6 +1202,9 @@ private void setFinalResult(Connection connection, Message.Response response) {
}
}
parentTracingInfo.setReplicas(replicasBuilder.toString());
parentTracingInfo.setCacheReadCount(buf.getInt());
parentTracingInfo.setDmaReadCount(buf.getInt());
parentTracingInfo.setDmaBytesRead(buf.getInt());
}

parentTracingInfo.tracingFinished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ public void setOperationType(String operationType) {}
@Override
public void setReplicas(String replicas) {}

@Override
public void setCacheReadCount(int cacheReadCount) {}

@Override
public void setDmaReadCount(int dmaReadCount) {}

@Override
public void setDmaBytesRead(int dmaBytesRead) {}

@Override
public void recordException(Exception exception) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,27 @@ enum StatusCode {
*/
void setReplicas(String replicas);

/**
* Adds provided cache reads counter to the trace.
*
* @param cacheReadCount the counter to be set.
*/
void setCacheReadCount(int cacheReadCount);

/**
* Adds provided DMA reads counter to the trace.
*
* @param dmaReadCount the counter to be set.
*/
void setDmaReadCount(int dmaReadCount);

/**
* Adds provided counter of bytes read in DMA reads to the trace.
*
* @param dmaBytesRead the counter to be set.
*/
void setDmaBytesRead(int dmaBytesRead);

/**
* Records in the trace that the provided exception occured.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class TestTracingInfo implements TracingInfo {
private String table;
private String operationType;
private String replicas;
private Integer cacheReadCount;
private Integer dmaReadCount;
private Integer dmaBytesRead;

public TestTracingInfo(PrecisionLevel precision) {
this.precision = precision;
Expand Down Expand Up @@ -165,6 +168,21 @@ public void setReplicas(String replicas) {
this.replicas = replicas;
}

@Override
public void setCacheReadCount(int cacheReadCount) {
this.cacheReadCount = cacheReadCount;
}

@Override
public void setDmaReadCount(int dmaReadCount) {
this.dmaReadCount = dmaReadCount;
}

@Override
public void setDmaBytesRead(int dmaBytesRead) {
this.dmaBytesRead = dmaBytesRead;
}

@Override
public void recordException(Exception exception) {
if (this.exceptions == null) {
Expand Down Expand Up @@ -277,6 +295,18 @@ public String getReplicas() {
return replicas;
}

public Integer getcacheReadCount() {
return cacheReadCount;
}

public Integer getDmaReadCount() {
return dmaReadCount;
}

public Integer getDmaBytesRead() {
return dmaBytesRead;
}

public StatusCode getStatusCode() {
return statusCode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,24 @@ public void setReplicas(String replicas) {
span.setAttribute("db.scylla.replicas", replicas);
}

@Override
public void setCacheReadCount(int cacheReadCount) {
assertStarted();
span.setAttribute("db.scylla.cache_read_count", cacheReadCount);
}

@Override
public void setDmaReadCount(int dmaReadCount) {
assertStarted();
span.setAttribute("db.scylla.dma_read_count", dmaReadCount);
}

@Override
public void setDmaBytesRead(int dmaBytesRead) {
assertStarted();
span.setAttribute("db.scylla.dma_bytes_read", dmaBytesRead);
}

private io.opentelemetry.api.trace.StatusCode mapStatusCode(StatusCode code) {
switch (code) {
case OK:
Expand Down