Skip to content

Commit f898f7f

Browse files
committed
Collect metrics for wikidata .ttl?flavor=dump
1 parent b1275e4 commit f898f7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

whelk-core/src/main/groovy/whelk/external/Wikidata.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.apache.jena.rdf.model.Model
66
import org.apache.jena.rdf.model.ModelFactory
77
import org.apache.jena.rdf.model.RDFNode
88
import whelk.component.ElasticSearch
9+
import whelk.util.Metrics
910

1011
class Wikidata implements Mapper {
1112
@Override
@@ -70,7 +71,9 @@ class WikidataEntity {
7071

7172
private void loadGraph() {
7273
try {
73-
graph.read("https://www.wikidata.org/wiki/Special:EntityData/${shortId}.ttl?flavor=dump", "Turtle")
74+
Metrics.clientTimer.labels(Wikidata.class.getSimpleName(), 'ttl-dump').time {
75+
graph.read("https://www.wikidata.org/wiki/Special:EntityData/${shortId}.ttl?flavor=dump", "Turtle")
76+
}
7477
} catch (Exception ex) {
7578
println("Unable to load graph for entity ${entityIri}")
7679
}

0 commit comments

Comments
 (0)