Skip to content

Commit

Permalink
filecontent: report itemsRead metric (#1002)
Browse files Browse the repository at this point in the history
Since filecontent doesn't go through `SdkV1Relation.{buildScan, getStream}` to implement reads
read metrics weren't being automatically reported.

Now it will do `itemsRead.inc()` once per line
  • Loading branch information
dmivankov authored Dec 18, 2024
1 parent cd5dbfe commit 3902217
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/cognite/spark/v1/FileContentRelation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class FileContentRelation(config: RelationConfig, fileExternalId: String, inferS
StreamIterator(
Stream
.eval(validUrl)
.flatMap(readUrlContentLines),
.flatMap(readUrlContentLines)
.evalTap(_ => IO.delay { itemsRead.inc() }),
maxParallelism * 2,
None
)
Expand Down

0 comments on commit 3902217

Please sign in to comment.