mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
updated ops to only log to debug on success
This commit is contained in:
parent
a50818c9cb
commit
753c945a32
@ -53,8 +53,7 @@ public class PineconeDeleteOpDispenser extends PineconeOpDispenser {
|
||||
|
||||
@Override
|
||||
public PineconeOp apply(long value) {
|
||||
return new PineconeDeleteOp(pcFunction
|
||||
.apply(value)
|
||||
return new PineconeDeleteOp(pcFunction.apply(value)
|
||||
.getConnection(targetFunction.apply(value)),
|
||||
deleteRequestFunc.apply(value));
|
||||
}
|
||||
|
@ -70,7 +70,8 @@ public class PineconeDescribeIndexStatsOpDispenser extends PineconeOpDispenser {
|
||||
|
||||
@Override
|
||||
public PineconeOp apply(long value) {
|
||||
return new PineconeDescribeIndexStatsOp(pcFunction.apply(value).getConnection(targetFunction.apply(value)),
|
||||
return new PineconeDescribeIndexStatsOp(pcFunction.apply(value)
|
||||
.getConnection(targetFunction.apply(value)),
|
||||
indexStatsRequestFunc.apply(value));
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,8 @@ public class PineconeFetchOpDispenser extends PineconeOpDispenser {
|
||||
|
||||
@Override
|
||||
public PineconeOp apply(long value) {
|
||||
return new PineconeFetchOp(pcFunction.apply(value).getConnection(targetFunction.apply(value)),
|
||||
return new PineconeFetchOp(pcFunction.apply(value)
|
||||
.getConnection(targetFunction.apply(value)),
|
||||
fetchRequestFunc.apply(value));
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class PineconeDeleteOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
DeleteResponse response = connection.getBlockingStub().delete(request);
|
||||
logger.info(response.toString());
|
||||
logger.debug("Pincecone delete request successful: " + response.toString());
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do delete", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
@ -20,9 +20,12 @@ import io.nosqlbench.engine.api.templating.ParsedOp;
|
||||
import io.pinecone.proto.DescribeIndexStatsRequest;
|
||||
import io.pinecone.proto.DescribeIndexStatsResponse;
|
||||
import io.pinecone.PineconeConnection;
|
||||
import io.pinecone.proto.NamespaceSummary;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PineconeDescribeIndexStatsOp extends PineconeOp {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PineconeDescribeIndexStatsOp.class);
|
||||
@ -44,7 +47,12 @@ public class PineconeDescribeIndexStatsOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
DescribeIndexStatsResponse response = connection.getBlockingStub().describeIndexStats(request);
|
||||
// Do soemething with the response...
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Vector counts:");
|
||||
for (Map.Entry<String, NamespaceSummary> namespace : response.getNamespacesMap().entrySet()) {
|
||||
logger.debug(namespace.getKey() + ": " + namespace.getValue().getVectorCount());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do DescribeIndexStats", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
@ -20,9 +20,12 @@ import io.nosqlbench.engine.api.templating.ParsedOp;
|
||||
import io.pinecone.proto.FetchRequest;
|
||||
import io.pinecone.PineconeConnection;
|
||||
import io.pinecone.proto.FetchResponse;
|
||||
import io.pinecone.proto.Vector;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PineconeFetchOp extends PineconeOp {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(PineconeFetchOp.class);
|
||||
@ -44,7 +47,11 @@ public class PineconeFetchOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
FetchResponse response = connection.getBlockingStub().fetch(request);
|
||||
// Do soemething with the response...
|
||||
if (logger.isDebugEnabled()) {
|
||||
for (Map.Entry<String, Vector> vectors: response.getVectorsMap().entrySet()) {
|
||||
logger.debug(vectors.getKey() + ": " + vectors.getValue().toString());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do Fetch", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
@ -20,6 +20,8 @@ import io.nosqlbench.engine.api.templating.ParsedOp;
|
||||
import io.pinecone.proto.QueryRequest;
|
||||
import io.pinecone.PineconeConnection;
|
||||
import io.pinecone.proto.QueryResponse;
|
||||
import io.pinecone.proto.ScoredVector;
|
||||
import io.pinecone.proto.SingleQueryResults;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@ -44,8 +46,13 @@ public class PineconeQueryOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
QueryResponse response = connection.getBlockingStub().query(request);
|
||||
logger.info("got query result ids: "
|
||||
+ response.getResultsList().get(0).getMatchesList());
|
||||
if (logger.isDebugEnabled()) {
|
||||
for (SingleQueryResults results : response.getResultsList()) {
|
||||
for (ScoredVector scored : results.getMatchesList()) {
|
||||
logger.debug(scored.getId() + ": " + scored.getScore());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do Query", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
@ -44,7 +44,7 @@ public class PineconeUpdateOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
UpdateResponse response = connection.getBlockingStub().update(request);
|
||||
// Do soemething with the response...
|
||||
logger.debug("UpdateResponse succesful: " + response.toString());
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do Update", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
@ -44,7 +44,7 @@ public class PineconeUpsertOp extends PineconeOp {
|
||||
public void run() {
|
||||
try {
|
||||
UpsertResponse response = connection.getBlockingStub().upsert(request);
|
||||
logger.info("Put " + response.getUpsertedCount() + " vectors into the index");
|
||||
logger.debug("Put " + response.getUpsertedCount() + " vectors into the index");
|
||||
} catch (Exception e) {
|
||||
logger.error("Exception %s caught trying to do upsert", e.getMessage());
|
||||
logger.error(e.getStackTrace());
|
||||
|
Loading…
Reference in New Issue
Block a user