Skip to content

Commit

Permalink
fix metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mono424 committed May 11, 2024
1 parent 0e72fbb commit aa0de51
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/notioncrawler/cmd/crawler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func main() {
if err := influxWriteAPI.WritePoint(context.Background(), influxdb2.NewPointWithMeasurement("notion_crawler_processing_item_started").
AddField("processed", processed).
AddField("cacheMisses", cacheMisses).
AddField("timeElapsed", time.Since(start)).
AddField("timeElapsed", time.Since(start).Milliseconds()).
SetTime(time.Now())); err != nil {
log.Println("Failed to write influxdb point")
}
Expand All @@ -162,9 +162,9 @@ func main() {
if err := influxWriteAPI.WritePoint(context.Background(), influxdb2.NewPointWithMeasurement("notion_crawler_processing_item_ended").
AddField("processed", processed).
AddField("cacheMisses", cacheMisses).
AddField("timeElapsed", time.Since(start)).
AddField("timeElapsed", time.Since(start).Milliseconds()).
AddField("wasCacheMiss", res.CacheMiss).
AddField("itemCrawlDuration", elapsedItem).
AddField("itemCrawlDuration", elapsedItem.Milliseconds()).
SetTime(time.Now())); err != nil {
log.Println("Failed to write influxdb point")
}
Expand All @@ -176,7 +176,7 @@ func main() {
if err := influxWriteAPI.WritePoint(context.Background(), influxdb2.NewPointWithMeasurement("notion_crawler_ended").
AddField("processed", processed).
AddField("cacheMisses", cacheMisses).
AddField("timeElapsed", elapsed).
AddField("timeElapsed", elapsed.Milliseconds()).
AddField("wasCanceled", wasCanceled).
SetTime(time.Now())); err != nil {
log.Println("Failed to write influxdb point")
Expand Down

0 comments on commit aa0de51

Please sign in to comment.