Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
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(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/80/365580/1

diff --git a/includes/ConstraintCheck/Helper/SparqlHelper.php 
b/includes/ConstraintCheck/Helper/SparqlHelper.php
index d73a042..3799cdd 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: newchange
Gerrit-Change-Id: I4d93a1b67798201ba9338967c7746538cf2833f0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>

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

Reply via email to