Repository: jena Updated Branches: refs/heads/master ee9c98b10 -> 88fbc93d2
Mis-capitalized counter name. Add null checks. Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/bbe2c6c0 Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/bbe2c6c0 Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/bbe2c6c0 Branch: refs/heads/master Commit: bbe2c6c0eefab11bbafce37a50fd6d7316baa047 Parents: 4a0c2ab Author: Andy Seaborne <[email protected]> Authored: Tue Nov 28 16:05:34 2017 +0000 Committer: Andy Seaborne <[email protected]> Committed: Mon Dec 11 14:56:08 2017 +0000 ---------------------------------------------------------------------- .../java/org/apache/jena/fuseki/mgt/ActionStats.java | 11 ++++++----- .../java/org/apache/jena/fuseki/server/CounterName.java | 6 +++++- .../java/org/apache/jena/fuseki/servlets/ActionREST.java | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/bbe2c6c0/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionStats.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionStats.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionStats.java index 072b604..54ee095 100644 --- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionStats.java +++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/mgt/ActionStats.java @@ -169,11 +169,12 @@ public class ActionStats extends ActionContainerItem out.println(" Bad = "+counter(dSrv, Operation.Upload, CounterName.RequestsBad)) ; out.println(" SPARQL Graph Store Protocol:") ; - out.println(" GETs = "+gspValue(dSrv, CounterName.HTTPget)+ " (good="+gspValue(dSrv, CounterName.HTTPgetGood)+"/bad="+gspValue(dSrv, CounterName.HTTPGetBad)+")") ; - out.println(" PUTs = "+gspValue(dSrv, CounterName.HTTPput)+ " (good="+gspValue(dSrv, CounterName.HTTPputGood)+"/bad="+gspValue(dSrv, CounterName.HTTPputBad)+")") ; - out.println(" POSTs = "+gspValue(dSrv, CounterName.HTTPpost)+ " (good="+gspValue(dSrv, CounterName.HTTPpostGood)+"/bad="+gspValue(dSrv, CounterName.HTTPpostBad)+")") ; - out.println(" DELETEs = "+gspValue(dSrv, CounterName.HTTPdelete)+ " (good="+gspValue(dSrv, CounterName.HTTPdeleteGood)+"/bad="+gspValue(dSrv, CounterName.HTTPdeleteBad)+")") ; - out.println(" HEADs = "+gspValue(dSrv, CounterName.HTTPhead)+ " (good="+gspValue(dSrv, CounterName.HTTPheadGood)+"/bad="+gspValue(dSrv, CounterName.HTTPheadBad)+")") ; + out.println(" GETs = "+gspValue(dSrv, CounterName.HTTPget) + " (good="+gspValue(dSrv, CounterName.HTTPgetGood)+"/bad="+gspValue(dSrv, CounterName.HTTPgetBad)+")") ; + out.println(" PUTs = "+gspValue(dSrv, CounterName.HTTPput) + " (good="+gspValue(dSrv, CounterName.HTTPputGood)+"/bad="+gspValue(dSrv, CounterName.HTTPputBad)+")") ; + out.println(" POSTs = "+gspValue(dSrv, CounterName.HTTPpost) + " (good="+gspValue(dSrv, CounterName.HTTPpostGood)+"/bad="+gspValue(dSrv, CounterName.HTTPpostBad)+")") ; + out.println(" PATCHs = "+gspValue(dSrv, CounterName.HTTPpatch) + " (good="+gspValue(dSrv, CounterName.HTTPpatchGood)+"/bad="+gspValue(dSrv, CounterName.HTTPpatchBad)+")") ; + out.println(" DELETEs = "+gspValue(dSrv, CounterName.HTTPdelete) + " (good="+gspValue(dSrv, CounterName.HTTPdeleteGood)+"/bad="+gspValue(dSrv, CounterName.HTTPdeleteBad)+")") ; + out.println(" HEADs = "+gspValue(dSrv, CounterName.HTTPhead) + " (good="+gspValue(dSrv, CounterName.HTTPheadGood)+"/bad="+gspValue(dSrv, CounterName.HTTPheadBad)+")") ; } private long counter(DataService dSrv, Operation operation, CounterName cName) { http://git-wip-us.apache.org/repos/asf/jena/blob/bbe2c6c0/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/CounterName.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/CounterName.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/CounterName.java index a66eff0..7ad8cfd 100644 --- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/CounterName.java +++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/CounterName.java @@ -18,11 +18,15 @@ package org.apache.jena.fuseki.server; +import java.util.Objects; + /** Names for all counters */ public class CounterName { // Create intern'ed symbols. static private NameMgr<CounterName> mgr = new NameMgr<>(); static public CounterName register(String name, String hierarchicalName) { + Objects.requireNonNull(name, "name"); + Objects.requireNonNull(hierarchicalName, "hierarchicalName"); return mgr.register(name, (n)->new CounterName(name, hierarchicalName)); } @@ -62,7 +66,7 @@ public class CounterName { public static final CounterName HTTPget = register("HTTPget", "http.get.requests"); public static final CounterName HTTPgetGood = register("HTTPgetGood", "http.get.requests.good"); - public static final CounterName HTTPGetBad = register("HTTPGetBad", "http.get.requests.bad"); + public static final CounterName HTTPgetBad = register("HTTPGetBad", "http.get.requests.bad"); public static final CounterName HTTPpost = register("HTTPpost", "http.post.requests"); public static final CounterName HTTPpostGood = register("HTTPpostGood", "http.post.requests.good"); http://git-wip-us.apache.org/repos/asf/jena/blob/bbe2c6c0/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java ---------------------------------------------------------------------- diff --git a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java index 4304399..f9f0443 100644 --- a/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java +++ b/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ActionREST.java @@ -76,7 +76,7 @@ public abstract class ActionREST extends ActionService doGet(action) ; incCounter(action.getEndpoint(), CounterName.HTTPgetGood) ; } catch ( ActionErrorException ex) { - incCounter(action.getEndpoint(), CounterName.HTTPGetBad) ; + incCounter(action.getEndpoint(), CounterName.HTTPgetBad) ; throw ex ; } }
