jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/365580 )

Change subject: Add tracking for query errors
......................................................................


Add tracking for query errors

This tracks the HTTP status code of the response, and also checks if the
response text indicates a query timeout.

Change-Id: I4d93a1b67798201ba9338967c7746538cf2833f0
---
M includes/ConstraintCheck/Helper/SparqlHelper.php
1 file changed, 12 insertions(+), 0 deletions(-)

Approvals:
  Jonas Kress (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ConstraintCheck/Helper/SparqlHelper.php 
b/includes/ConstraintCheck/Helper/SparqlHelper.php
index d73a042..56d99b8 100644
--- a/includes/ConstraintCheck/Helper/SparqlHelper.php
+++ b/includes/ConstraintCheck/Helper/SparqlHelper.php
@@ -236,6 +236,18 @@
                        return $arr;
                } else {
                        $this->dataFactory->increment( 
'wikibase.quality.constraints.sparql.error' );
+
+                       $this->dataFactory->increment(
+                               
"wikibase.quality.constraints.sparql.error.http.{$request->getStatus()}"
+                       );
+
+                       $timeoutExceptionClass = 
'com.bigdata.bop.engine.QueryTimeoutException';
+                       if ( strpos( $request->getContent(), " 
$timeoutExceptionClass:" ) !== false ) {
+                               $this->dataFactory->increment(
+                                       
'wikibase.quality.constraints.sparql.error.timeout'
+                               );
+                       }
+
                        throw new SparqlHelperException();
                }
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/365580
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4d93a1b67798201ba9338967c7746538cf2833f0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to