Skip to content
Merged
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 @@ -147,13 +147,9 @@ public void onNext(BatchGetDocumentsResponse response) {

numResponses++;
if (numResponses == 1) {
tracer
.getCurrentSpan()
.addAnnotation("Firestore.BatchGet: First response");
tracer.getCurrentSpan().addAnnotation("Firestore.BatchGet: First response");
} else if (numResponses % 100 == 0) {
tracer
.getCurrentSpan()
.addAnnotation("Firestore.BatchGet: Received 100 responses");
tracer.getCurrentSpan().addAnnotation("Firestore.BatchGet: Received 100 responses");
}

switch (response.getResultCase()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,8 @@ private void stream(
request.setTransaction(transactionId);
}

Tracing.getTracer().getCurrentSpan()
Tracing.getTracer()
.getCurrentSpan()
.addAnnotation(
"Firestore.Query: Start",
ImmutableMap.of(
Expand All @@ -940,13 +941,13 @@ private void stream(
public void onNext(RunQueryResponse response) {
if (!firstResponse) {
firstResponse = true;
Tracing.getTracer().getCurrentSpan()
.addAnnotation("Firestore.Query: First response");
Tracing.getTracer().getCurrentSpan().addAnnotation("Firestore.Query: First response");
}
if (response.hasDocument()) {
numDocuments++;
if (numDocuments % 100 == 0) {
Tracing.getTracer().getCurrentSpan()
Tracing.getTracer()
.getCurrentSpan()
.addAnnotation("Firestore.Query: Received 100 documents");
}
Document document = response.getDocument();
Expand All @@ -970,12 +971,12 @@ public void onError(Throwable throwable) {

@Override
public void onCompleted() {
Tracing.getTracer().getCurrentSpan()
Tracing.getTracer()
.getCurrentSpan()
.addAnnotation(
"Firestore.Query: Completed",
ImmutableMap.of(
"numDocuments",
AttributeValue.longAttributeValue(numDocuments)));
"numDocuments", AttributeValue.longAttributeValue(numDocuments)));
documentObserver.onCompleted(readTime);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,11 @@ private T performDelete(

/** Commit the current batch. */
ApiFuture<List<WriteResult>> commit(@Nullable ByteString transactionId) {
Tracing.getTracer().getCurrentSpan().addAnnotation(
"CloudFirestore.Commit",
ImmutableMap.of("numDocuments", AttributeValue.longAttributeValue(mutations.size())));
Tracing.getTracer()
.getCurrentSpan()
.addAnnotation(
"CloudFirestore.Commit",
ImmutableMap.of("numDocuments", AttributeValue.longAttributeValue(mutations.size())));

final CommitRequest.Builder request = CommitRequest.newBuilder();
request.setDatabase(firestore.getDatabaseName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,16 +536,16 @@ public void getResult() throws Exception {
Iterator<DocumentChange> changeIterator = result.getDocumentChanges().iterator();

DocumentChange documentChange = changeIterator.next();
assertEquals("doc1",documentChange.getDocument().getId());
assertEquals(DocumentChange.Type.ADDED,documentChange.getType());
assertEquals(-1,documentChange.getOldIndex());
assertEquals(0,documentChange.getNewIndex());
assertEquals("doc1", documentChange.getDocument().getId());
assertEquals(DocumentChange.Type.ADDED, documentChange.getType());
assertEquals(-1, documentChange.getOldIndex());
assertEquals(0, documentChange.getNewIndex());

documentChange = changeIterator.next();
assertEquals("doc2",documentChange.getDocument().getId());
assertEquals(DocumentChange.Type.ADDED,documentChange.getType());
assertEquals(-1,documentChange.getOldIndex());
assertEquals(1,documentChange.getNewIndex());
assertEquals("doc2", documentChange.getDocument().getId());
assertEquals(DocumentChange.Type.ADDED, documentChange.getType());
assertEquals(-1, documentChange.getOldIndex());
assertEquals(1, documentChange.getNewIndex());

assertFalse(changeIterator.hasNext());

Expand Down