diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..edbd3f4 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2012, Rien Nentjes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..edbd3f4 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2012, Rien Nentjes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/JdbcLogger.java b/src/nl/astraeus/jdbc/JdbcLogger.java index 08e525d..e9cc338 100644 --- a/src/nl/astraeus/jdbc/JdbcLogger.java +++ b/src/nl/astraeus/jdbc/JdbcLogger.java @@ -112,7 +112,7 @@ } public String getSql() { - if (Settings.get().isFormattedQueries()) { + if (JdbcLogger.get().isFormattedQueries()) { return SqlFormatter.getHTMLFormattedSQL(sql); } else { return sql; @@ -153,6 +153,9 @@ private final List queries; private long startTime; private boolean recording = false; + + private int numberOfQueries = 2500; + private boolean formattedQueries = true; public JdbcLogger() { queries = new LinkedList(); @@ -187,7 +190,7 @@ synchronized (queries) { queries.add(entry); - while (queries.size() > Settings.get().getNumberOfQueries()) { + while (queries.size() > getNumberOfQueries()) { entry = queries.remove(0); startTime = entry.getMilli(); } @@ -204,4 +207,19 @@ } } + public int getNumberOfQueries() { + return numberOfQueries; + } + + public void setNumberOfQueries(int numberOfQueries) { + this.numberOfQueries = numberOfQueries; + } + + public boolean isFormattedQueries() { + return formattedQueries; + } + + public void setFormattedQueries(boolean formattedQueries) { + this.formattedQueries = formattedQueries; + } } diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..edbd3f4 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2012, Rien Nentjes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/JdbcLogger.java b/src/nl/astraeus/jdbc/JdbcLogger.java index 08e525d..e9cc338 100644 --- a/src/nl/astraeus/jdbc/JdbcLogger.java +++ b/src/nl/astraeus/jdbc/JdbcLogger.java @@ -112,7 +112,7 @@ } public String getSql() { - if (Settings.get().isFormattedQueries()) { + if (JdbcLogger.get().isFormattedQueries()) { return SqlFormatter.getHTMLFormattedSQL(sql); } else { return sql; @@ -153,6 +153,9 @@ private final List queries; private long startTime; private boolean recording = false; + + private int numberOfQueries = 2500; + private boolean formattedQueries = true; public JdbcLogger() { queries = new LinkedList(); @@ -187,7 +190,7 @@ synchronized (queries) { queries.add(entry); - while (queries.size() > Settings.get().getNumberOfQueries()) { + while (queries.size() > getNumberOfQueries()) { entry = queries.remove(0); startTime = entry.getMilli(); } @@ -204,4 +207,19 @@ } } + public int getNumberOfQueries() { + return numberOfQueries; + } + + public void setNumberOfQueries(int numberOfQueries) { + this.numberOfQueries = numberOfQueries; + } + + public boolean isFormattedQueries() { + return formattedQueries; + } + + public void setFormattedQueries(boolean formattedQueries) { + this.formattedQueries = formattedQueries; + } } diff --git a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java index 08eb817..96690ba 100644 --- a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java +++ b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java @@ -79,6 +79,7 @@ boolean ajax = "true".equals(req.getParameter("ajax")); resp.setContentType("text/html"); + Settings.get().readSettings(req); Page page = (Page)session.getAttribute("page"); @@ -120,7 +121,9 @@ resp.getWriter().print(Warnings.get(req).render(req)); long time = System.nanoTime(); + resp.getWriter().println("
"); resp.getWriter().print(page.render(req)); + resp.getWriter().println("
"); Settings.get().saveSettings(resp); diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..edbd3f4 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2012, Rien Nentjes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/JdbcLogger.java b/src/nl/astraeus/jdbc/JdbcLogger.java index 08e525d..e9cc338 100644 --- a/src/nl/astraeus/jdbc/JdbcLogger.java +++ b/src/nl/astraeus/jdbc/JdbcLogger.java @@ -112,7 +112,7 @@ } public String getSql() { - if (Settings.get().isFormattedQueries()) { + if (JdbcLogger.get().isFormattedQueries()) { return SqlFormatter.getHTMLFormattedSQL(sql); } else { return sql; @@ -153,6 +153,9 @@ private final List queries; private long startTime; private boolean recording = false; + + private int numberOfQueries = 2500; + private boolean formattedQueries = true; public JdbcLogger() { queries = new LinkedList(); @@ -187,7 +190,7 @@ synchronized (queries) { queries.add(entry); - while (queries.size() > Settings.get().getNumberOfQueries()) { + while (queries.size() > getNumberOfQueries()) { entry = queries.remove(0); startTime = entry.getMilli(); } @@ -204,4 +207,19 @@ } } + public int getNumberOfQueries() { + return numberOfQueries; + } + + public void setNumberOfQueries(int numberOfQueries) { + this.numberOfQueries = numberOfQueries; + } + + public boolean isFormattedQueries() { + return formattedQueries; + } + + public void setFormattedQueries(boolean formattedQueries) { + this.formattedQueries = formattedQueries; + } } diff --git a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java index 08eb817..96690ba 100644 --- a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java +++ b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java @@ -79,6 +79,7 @@ boolean ajax = "true".equals(req.getParameter("ajax")); resp.setContentType("text/html"); + Settings.get().readSettings(req); Page page = (Page)session.getAttribute("page"); @@ -120,7 +121,9 @@ resp.getWriter().print(Warnings.get(req).render(req)); long time = System.nanoTime(); + resp.getWriter().println("
"); resp.getWriter().print(page.render(req)); + resp.getWriter().println("
"); Settings.get().saveSettings(resp); diff --git a/src/nl/astraeus/jdbc/web/bottom.html b/src/nl/astraeus/jdbc/web/bottom.html index 1288de4..955c589 100644 --- a/src/nl/astraeus/jdbc/web/bottom.html +++ b/src/nl/astraeus/jdbc/web/bottom.html @@ -1,8 +1,18 @@ - + + - +
+ + + + + + + \ No newline at end of file diff --git a/LICENCE.txt b/LICENCE.txt new file mode 100644 index 0000000..edbd3f4 --- /dev/null +++ b/LICENCE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2012, Rien Nentjes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/JdbcLogger.java b/src/nl/astraeus/jdbc/JdbcLogger.java index 08e525d..e9cc338 100644 --- a/src/nl/astraeus/jdbc/JdbcLogger.java +++ b/src/nl/astraeus/jdbc/JdbcLogger.java @@ -112,7 +112,7 @@ } public String getSql() { - if (Settings.get().isFormattedQueries()) { + if (JdbcLogger.get().isFormattedQueries()) { return SqlFormatter.getHTMLFormattedSQL(sql); } else { return sql; @@ -153,6 +153,9 @@ private final List queries; private long startTime; private boolean recording = false; + + private int numberOfQueries = 2500; + private boolean formattedQueries = true; public JdbcLogger() { queries = new LinkedList(); @@ -187,7 +190,7 @@ synchronized (queries) { queries.add(entry); - while (queries.size() > Settings.get().getNumberOfQueries()) { + while (queries.size() > getNumberOfQueries()) { entry = queries.remove(0); startTime = entry.getMilli(); } @@ -204,4 +207,19 @@ } } + public int getNumberOfQueries() { + return numberOfQueries; + } + + public void setNumberOfQueries(int numberOfQueries) { + this.numberOfQueries = numberOfQueries; + } + + public boolean isFormattedQueries() { + return formattedQueries; + } + + public void setFormattedQueries(boolean formattedQueries) { + this.formattedQueries = formattedQueries; + } } diff --git a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java index 08eb817..96690ba 100644 --- a/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java +++ b/src/nl/astraeus/jdbc/web/JdbcStatisticsServlet.java @@ -79,6 +79,7 @@ boolean ajax = "true".equals(req.getParameter("ajax")); resp.setContentType("text/html"); + Settings.get().readSettings(req); Page page = (Page)session.getAttribute("page"); @@ -120,7 +121,9 @@ resp.getWriter().print(Warnings.get(req).render(req)); long time = System.nanoTime(); + resp.getWriter().println("
"); resp.getWriter().print(page.render(req)); + resp.getWriter().println("
"); Settings.get().saveSettings(resp); diff --git a/src/nl/astraeus/jdbc/web/bottom.html b/src/nl/astraeus/jdbc/web/bottom.html index 1288de4..955c589 100644 --- a/src/nl/astraeus/jdbc/web/bottom.html +++ b/src/nl/astraeus/jdbc/web/bottom.html @@ -1,8 +1,18 @@ - + + - +
+ + + + + + + \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/web/head.html b/src/nl/astraeus/jdbc/web/head.html index 54d9cb8..c99b11e 100644 --- a/src/nl/astraeus/jdbc/web/head.html +++ b/src/nl/astraeus/jdbc/web/head.html @@ -11,66 +11,16 @@ + - - - - + + + + + + + \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/web/head.html b/src/nl/astraeus/jdbc/web/head.html index 54d9cb8..c99b11e 100644 --- a/src/nl/astraeus/jdbc/web/head.html +++ b/src/nl/astraeus/jdbc/web/head.html @@ -11,66 +11,16 @@ + - - - - + + + + + + + \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/web/head.html b/src/nl/astraeus/jdbc/web/head.html index 54d9cb8..c99b11e 100644 --- a/src/nl/astraeus/jdbc/web/head.html +++ b/src/nl/astraeus/jdbc/web/head.html @@ -11,66 +11,16 @@ + - - - - + + + + + + + \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/web/head.html b/src/nl/astraeus/jdbc/web/head.html index 54d9cb8..c99b11e 100644 --- a/src/nl/astraeus/jdbc/web/head.html +++ b/src/nl/astraeus/jdbc/web/head.html @@ -11,66 +11,16 @@ + - - - - + + + + + + + \ No newline at end of file diff --git a/src/nl/astraeus/jdbc/web/head.html b/src/nl/astraeus/jdbc/web/head.html index 54d9cb8..c99b11e 100644 --- a/src/nl/astraeus/jdbc/web/head.html +++ b/src/nl/astraeus/jdbc/web/head.html @@ -11,66 +11,16 @@ + - - - - + +