You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2017/12/17 19:33:46 UTC
[14/28] jena git commit: Mis-capitalized counter name. Add null
checks.
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/19cedc22
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/19cedc22
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/19cedc22
Branch: refs/heads/master
Commit: 19cedc226687c20af76d2a4c5aa1a46cef3ab670
Parents: 6c2d03f
Author: Andy Seaborne <an...@apache.org>
Authored: Tue Nov 28 16:05:34 2017 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Tue Dec 12 10:07:37 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/19cedc22/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/19cedc22/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/19cedc22/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 ;
}
}