From f898f7f43457238df9dcf317806ee5e74163f731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olov=20Ylinenp=C3=A4=C3=A4?= Date: Mon, 25 Oct 2021 08:25:17 +0200 Subject: [PATCH] Collect metrics for wikidata .ttl?flavor=dump --- whelk-core/src/main/groovy/whelk/external/Wikidata.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/whelk-core/src/main/groovy/whelk/external/Wikidata.groovy b/whelk-core/src/main/groovy/whelk/external/Wikidata.groovy index a58e9fc1bc..b0fdef5e86 100644 --- a/whelk-core/src/main/groovy/whelk/external/Wikidata.groovy +++ b/whelk-core/src/main/groovy/whelk/external/Wikidata.groovy @@ -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 @@ -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}") }