Skip to content

Commit ad7efac

Browse files
committed
Display the time taken to update a graph by a given data source.
1 parent 62e6618 commit ad7efac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/client/transaction.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ func (cgt *Transaction) Commit() error {
113113
assetRemovalsChunks := utils.ChunkSlice(bulk.GetAssetRemovals(), chunkSize).([][]interface{})
114114
assetInsertionChunks := utils.ChunkSlice(bulk.GetAssetUpserts(), chunkSize).([][]interface{})
115115

116+
now := time.Now()
117+
116118
for _, rels := range relationRemovalsChunks {
117119
relations := []knowledge.Relation{}
118120
for _, r := range rels {
@@ -193,7 +195,9 @@ func (cgt *Transaction) Commit() error {
193195
}
194196
}
195197

196-
logrus.Debug("Finished uploading the graph...")
198+
elapsed := time.Since(now)
199+
200+
logrus.Debugf("Finished uploading the graph in %f seconds...", elapsed.Seconds())
197201

198202
cgt.onSuccess(cgt.newGraph)
199203
cgt.newGraph = knowledge.NewGraph()

0 commit comments

Comments
 (0)