Skip to content

Commit

Permalink
Collect metrics for wikidata .ttl?flavor=dump
Browse files Browse the repository at this point in the history
  • Loading branch information
olovy committed Oct 27, 2021
1 parent b851fad commit 5135d6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion whelk-core/src/main/groovy/whelk/external/Wikidata.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.apache.jena.rdf.model.Model
import org.apache.jena.rdf.model.ModelFactory
import org.apache.jena.rdf.model.RDFNode
import whelk.component.ElasticSearch
import whelk.util.Metrics

class Wikidata implements Mapper {
@Override
Expand Down Expand Up @@ -70,7 +71,9 @@ class WikidataEntity {

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

0 comments on commit 5135d6a

Please sign in to comment.