f)break;g.push(h)}}else for(;d
=1;--s)if(!((h=c*s)f)break;g.push(h)}}else g=l(d,p,Math.min(p-d,v)).map(a);return n?g.reverse():g},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var u=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/a(Math.round(o(t)));return n*i =0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=Y);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o =o.length)return null!=e&&n.sort(e),null!=r?r(n):n;for(var f,c,s,l=-1,h=n.length,d=o[i++],p=he(),v=a();++l >>1;s[v]=s;--l)c.point(g[l],y[l]);c.lineEnd(),c.areaEnd()}v&&(g[n]=+e(h,n,t),y[n]=+i(h,n,t),c.point(r?+r(h,n,t):g[n],o?+o(h,n,t):y[n]))}if(d)return c=null,d+""||null}function n(){return wf().defined(a).curve(f).context(u)}var e=mf,r=null,i=sf(0),o=xf,a=sf(!0),u=null,f=bf,c=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:sf(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:sf(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:sf(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:sf(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:sf(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:sf(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(a="function"==typeof n?n:sf(!!n),t):a},t.curve=function(n){return arguments.length?(f=n,null!=u&&(c=f(u)),t):f},t.context=function(n){return arguments.length?(null==n?u=c=null:c=f(u=n),t):u},t}function Af(t,n){return n0){if(o>l)return;o>s&&(s=o)}if(o=r-f,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=i-c,d||!(o<0)){if(o/=d,d<0){if(o>l)return;o>s&&(s=o)}else if(d>0){if(o0||l<1)||(s>0&&(t[0]=[f+s*h,c+s*d]),l<1&&(t[1]=[f+l*h,c+l*d]),!0)}}}}}function Nc(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,f=t[0],c=t.left,s=t.right,l=c[0],h=c[1],d=s[0],p=s[1],v=(l+d)/2,g=(h+p)/2;if(p===h){if(v=y)<<1|t>=g)&&(f=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=f)}else{var _=t-+this._x.call(null,v.data),b=n-+this._y.call(null,v.data),m=_*_+b*b;if(mt?1:n>=t?0:NaN},t.deviation=a,t.extent=u,t.histogram=function(){function t(t){var i,o,a=t.length,u=new Array(a);for(i=0;il;)h.pop(),--p;var v,g=new Array(p+1);for(i=0;i<=p;++i)(v=g[i]=[]).x0=i>0?h[i-1]:c,v.x1=i1?(d.on(t,n),o):d.on(t)}}},t.forceX=function(t){function n(t){for(var n,e=0,a=r.length;eOr(r[0],r[1])&&(r[1]=i[1]),Or(i[0],r[1])>Or(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=Or(r[1],i[0]))>a&&(a=u,gd=i[0],_d=r[1])}return Ad=Td=null,gd===1/0||yd===1/0?[[NaN,NaN],[NaN,NaN]]:[[gd,yd],[_d,bd]]},t.geoCentroid=function(t){Nd=Sd=Ed=kd=Cd=Pd=zd=Rd=Ld=Dd=Ud=0,br(t,gp);var n=Ld,e=Dd,r=Ud,i=n*n+e*e+r*r;return iw_)if(p>T_-w_)f.moveTo(l*y_(h),l*m_(h)),f.arc(0,0,l,h,d,!v),s>w_&&(f.moveTo(s*y_(d),s*m_(d)),f.arc(0,0,s,d,h,v));else{var g,y,_=h,b=d,m=h,x=d,w=p,M=p,A=u.apply(this,arguments)/2,T=A>w_&&(i?+i.apply(this,arguments):x_(s*s+l*l)),N=b_(v_(l-s)/2,+r.apply(this,arguments)),S=N,E=N;if(T>w_){var k=lf(T/s*m_(A)),C=lf(T/l*m_(A));(w-=2*k)>w_?(k*=v?1:-1,m+=k,x-=k):(w=0,m=x=(h+d)/2),(M-=2*C)>w_?(C*=v?1:-1,_+=C,b-=C):(M=0,_=b=(h+d)/2)}var P=l*y_(_),z=l*m_(_),R=s*y_(x),L=s*m_(x);if(N>w_){var D=l*y_(b),U=l*m_(b),q=s*y_(m),O=s*m_(m);if(p
-
-
-
-
diff --git a/src/main/resources/main.css b/src/main/resources/main.css
deleted file mode 100755
index 83ef0af..0000000
--- a/src/main/resources/main.css
+++ /dev/null
@@ -1,106 +0,0 @@
-.datagrid table {
- border-collapse: collapse;
- text-align: left;
- width: 100%;
-}
-
-.datagrid {
- font: normal 12px/150% Arial, Helvetica, sans-serif;
- background: #fff;
- overflow: hidden;
- border: 1px solid #006699;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-.datagrid table td, .datagrid table th {
- padding: 3px 10px;
-}
-
-.datagrid table thead th {
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #006699), color-stop(1, #00557F));
- background: -moz-linear-gradient(center top, #006699 5%, #00557F 100%);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#006699', endColorstr='#00557F');
- background-color: #006699;
- color: #ffffff;
- font-size: 15px;
- font-weight: bold;
- border-left: 1px solid #0070A8;
-}
-
-.datagrid table thead th:first-child {
- border: none;
-}
-
-.datagrid table tbody td {
- color: #00496B;
- border-left: 1px solid #E1EEF4;
- font-size: 12px;
- font-weight: normal;
-}
-
-.datagrid table tbody .alt td {
- background: #E1EEF4;
- color: #00496B;
-}
-
-.datagrid table tbody td:first-child {
- border-left: none;
-}
-
-.datagrid table tbody tr:last-child td {
- border-bottom: none;
-}
-
-.datagrid table tfoot td div {
- border-top: 1px solid #006699;
- background: #E1EEF4;
-}
-
-.datagrid table tfoot td {
- padding: 0;
- font-size: 12px
-}
-
-.datagrid table tfoot td div {
- padding: 2px;
-}
-
-.datagrid table tfoot td ul {
- margin: 0;
- padding: 0;
- list-style: none;
- text-align: right;
-}
-
-.datagrid table tfoot li {
- display: inline;
-}
-
-.datagrid table tfoot li a {
- text-decoration: none;
- display: inline-block;
- padding: 2px 8px;
- margin: 1px;
- color: #FFFFFF;
- border: 1px solid #006699;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #006699), color-stop(1, #00557F));
- background: -moz-linear-gradient(center top, #006699 5%, #00557F 100%);
- background-color: #006699;
-}
-
-.datagrid table tfoot ul.active, .datagrid table tfoot ul a:hover {
- text-decoration: none;
- border-color: #006699;
- color: #FFFFFF;
- background: none;
- background-color: #00557F;
-}
-
-div.dhtmlx_window_active, div.dhx_modal_cover_dv {
- position: fixed !important;
-}
\ No newline at end of file
diff --git a/src/main/resources/perfix.js b/src/main/resources/perfix.js
deleted file mode 100644
index 943dbe5..0000000
--- a/src/main/resources/perfix.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function tabulate(data, columns) {
- d3.select('table').remove();
- var table = d3.select('body').append('table')
- var thead = table.append('thead')
- var tbody = table.append('tbody');
-
- thead.append('tr')
- .selectAll('th')
- .data(columns).enter()
- .append('th')
- .text(function (column) { return column; });
-
- var rows = tbody.selectAll('tr')
- .data(data)
- .enter()
- .append('tr');
-
- rows.selectAll('td')
- .data(function (row) {
- return columns.map(function (column) {
- return {column: column, value: row[column]};
- });
- })
- .enter()
- .append('td')
- .text(function (d) { return d.value; });
-
- return table;
-}
\ No newline at end of file
diff --git a/src/main/resources/static.json b/src/main/resources/static.json
deleted file mode 100644
index 9ec804f..0000000
--- a/src/main/resources/static.json
+++ /dev/null
@@ -1,44 +0,0 @@
-[
- {
- "name": "testperfix.Main.main(java.lang.String[])",
- "invocations": 1,
- "totalDuration": 1414878875,
- "average": 1.414878875E9
- },
- {
- "name": "testperfix.Main.run()",
- "invocations": 1,
- "totalDuration": 1414756159,
- "average": 1.414756159E9
- },
- {
- "name": "testperfix.Main.someJdbcStatentMethod()",
- "invocations": 1,
- "totalDuration": 399009103,
- "average": 3.99009103E8
- },
- {
- "name": "select CURRENT_DATE() -- simple statement",
- "invocations": 1,
- "totalDuration": 99705675,
- "average": 9.9705675E7
- },
- {
- "name": "testperfix.Main.someJdbcPreparedStatementMethod()",
- "invocations": 1,
- "totalDuration": 5880308,
- "average": 5880308.0
- },
- {
- "name": "testperfix.Main.someOtherMethod()",
- "invocations": 1,
- "totalDuration": 1285359,
- "average": 1285359.0
- },
- {
- "name": "select CURRENT_DATE() -- prepared statement",
- "invocations": 1,
- "totalDuration": 98241,
- "average": 98241.0
- }
-]
\ No newline at end of file
diff --git a/src/main/resources/tree.js b/src/main/resources/tree.js
deleted file mode 100644
index be0123e..0000000
--- a/src/main/resources/tree.js
+++ /dev/null
@@ -1,141 +0,0 @@
-var m = [20, 120, 20, 120],
- w = 1280 - m[1] - m[3],
- h = 800 - m[0] - m[2],
- i = 0,
- root;
-
-var tree = d3.layout.tree()
- .size([h, w]);
-
-var diagonal = d3.svg.diagonal()
- .projection(function(d) { return [d.y, d.x]; });
-
-var vis = d3.select("#body").append("svg:svg")
- .attr("width", w + m[1] + m[3])
- .attr("height", h + m[0] + m[2])
- .append("svg:g")
- .attr("transform", "translate(" + m[3] + "," + m[0] + ")");
-
-d3.json("flare.json", function(json) {
- root = json;
- root.x0 = h / 2;
- root.y0 = 0;
-
- function toggleAll(d) {
- if (d.children) {
- d.children.forEach(toggleAll);
- toggle(d);
- }
- }
-
- // Initialize the display to show a few nodes.
- root.children.forEach(toggleAll);
- toggle(root.children[1]);
- toggle(root.children[1].children[2]);
- toggle(root.children[9]);
- toggle(root.children[9].children[0]);
-
- update(root);
-});
-
-function update(source) {
- var duration = d3.event && d3.event.altKey ? 5000 : 500;
-
- // Compute the new tree layout.
- var nodes = tree.nodes(root).reverse();
-
- // Normalize for fixed-depth.
- nodes.forEach(function(d) { d.y = d.depth * 180; });
-
- // Update the nodes…
- var node = vis.selectAll("g.node")
- .data(nodes, function(d) { return d.id || (d.id = ++i); });
-
- // Enter any new nodes at the parent's previous position.
- var nodeEnter = node.enter().append("svg:g")
- .attr("class", "node")
- .attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; })
- .on("click", function(d) { toggle(d); update(d); });
-
- nodeEnter.append("svg:circle")
- .attr("r", 1e-6)
- .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });
-
- nodeEnter.append("svg:text")
- .attr("x", function(d) { return d.children || d._children ? -10 : 10; })
- .attr("dy", ".35em")
- .attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; })
- .text(function(d) { return d.name; })
- .style("fill-opacity", 1e-6);
-
- // Transition nodes to their new position.
- var nodeUpdate = node.transition()
- .duration(duration)
- .attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; });
-
- nodeUpdate.select("circle")
- .attr("r", 4.5)
- .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });
-
- nodeUpdate.select("text")
- .style("fill-opacity", 1);
-
- // Transition exiting nodes to the parent's new position.
- var nodeExit = node.exit().transition()
- .duration(duration)
- .attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; })
- .remove();
-
- nodeExit.select("circle")
- .attr("r", 1e-6);
-
- nodeExit.select("text")
- .style("fill-opacity", 1e-6);
-
- // Update the links…
- var link = vis.selectAll("path.link")
- .data(tree.links(nodes), function(d) { return d.target.id; });
-
- // Enter any new links at the parent's previous position.
- link.enter().insert("svg:path", "g")
- .attr("class", "link")
- .attr("d", function(d) {
- var o = {x: source.x0, y: source.y0};
- return diagonal({source: o, target: o});
- })
- .transition()
- .duration(duration)
- .attr("d", diagonal);
-
- // Transition links to their new position.
- link.transition()
- .duration(duration)
- .attr("d", diagonal);
-
- // Transition exiting nodes to the parent's new position.
- link.exit().transition()
- .duration(duration)
- .attr("d", function(d) {
- var o = {x: source.x, y: source.y};
- return diagonal({source: o, target: o});
- })
- .remove();
-
- // Stash the old positions for transition.
- nodes.forEach(function(d) {
- d.x0 = d.x;
- d.y0 = d.y;
- });
-}
-
-// Toggle children.
-function toggle(d) {
- if (d.children) {
- d._children = d.children;
- d.children = null;
- } else {
- d.children = d._children;
- d._children = null;
- }
-}
-
diff --git a/src/test/java/StatementTextTest.java b/src/test/java/StatementTextTest.java
new file mode 100644
index 0000000..dce61a3
--- /dev/null
+++ b/src/test/java/StatementTextTest.java
@@ -0,0 +1,14 @@
+import org.junit.Assert;
+import org.junit.Test;
+import perfix.instrument.StatementText;
+
+public class StatementTextTest {
+
+ @Test
+ public void testReplace(){
+ StatementText b = new StatementText("select ? from ?");
+ b.set(1, "alpha");
+ b.set(2, "beta");
+ Assert.assertEquals("select alpha from beta",b.toString());
+ }
+}
diff --git a/src/test/java/TestMethod.java b/src/test/java/TestMethod.java
deleted file mode 100644
index cd63de8..0000000
--- a/src/test/java/TestMethod.java
+++ /dev/null
@@ -1,16 +0,0 @@
-import org.junit.Test;
-import perfix.MethodInvocation;
-import perfix.Registry;
-
-public class TestMethod {
- @Test
- public void testAddMethodToRegistry() {
- MethodInvocation method = MethodInvocation.start("somename");
- method.stop();
- MethodInvocation method2 = MethodInvocation.start("somename");
- method2.stop();
-
- Registry.report(System.out);
- }
-
-}
diff --git a/src/testapp/java/testperfix/cmdline/App.java b/src/testapp/java/testperfix/cmdline/App.java
index d904906..b151f3c 100644
--- a/src/testapp/java/testperfix/cmdline/App.java
+++ b/src/testapp/java/testperfix/cmdline/App.java
@@ -42,8 +42,11 @@ public class App {
private static void someJdbcPreparedStatementMethod() {
try {
Connection connection = DriverManager.getConnection("jdbc:h2:mem:default", "sa", "");
-
- PreparedStatement preparedStatement = connection.prepareStatement("select CURRENT_DATE() -- prepared statement");
+ Statement statement = connection.createStatement();
+ statement.execute("create table t (v varchar(2))");
+ statement.close();
+ PreparedStatement preparedStatement = connection.prepareStatement("select * from t where v=? -- prepared statement");
+ preparedStatement.setDate(1, new Date(new java.util.Date().getTime()));
preparedStatement.executeQuery();
connection.close();
} catch (SQLException e) {