Permalink
Browse files

v6.41.0. Improvement.

- v6.41.0 June 25, 2013
	- Made debugging, tracing, and profiling easier
		- Added `docpad-debug` for easy debugging
		- Added `docpad-trace` for easy tracing
		- Added `--profile` for easy profiling
		- See our [debug guide](http://docpad.org/docs/debug) for details
  • Loading branch information...
1 parent aee517e commit 13b4f0dade392b8f2fa066ae130257d537c37de0 @balupton balupton committed Jun 24, 2013
Showing with 74 additions and 6 deletions.
  1. +7 −0 History.md
  2. +15 −2 bin/docpad-debug
  3. +17 −0 bin/docpad-trace
  4. +1 −0 locale/en.cson
  5. +7 −4 package.json
  6. +23 −0 src/lib/docpad.coffee
  7. +4 −0 src/lib/interfaces/console.coffee
View
@@ -1,5 +1,12 @@
## History
+- v6.41.0 June 25, 2013
+ - Made debugging, tracing, and profiling easier
+ - Added `docpad-debug` for easy debugging
+ - Added `docpad-trace` for easy tracing
+ - Added `--profile` for easy profiling
+ - See our [debug guide](http://docpad.org/docs/debug) for details
+
- v6.40.0 June 24, 2013
- Removed excessive dirname usage
- Updated dependencies
View
@@ -1,5 +1,18 @@
#!/usr/bin/env node
-var command = [process.argv[0],'--debug-brk',__dirname+'/../out/bin/docpad'].concat(process.argv.slice(2));
-require('bal-util').spawn(command,{cwd:process.cwd(),output:true},function(err){
+
+// Prefix our docpad executable with the node debug and profile flags
+// and suffix docpad with it's profile flag
+var command = [
+ process.argv[0],
+ '--debug-brk',
+ '--prof',
+ __dirname+'/docpad',
+].concat(process.argv.slice(2));
+
+// Output the command we'll be running
+console.log(command.join(' '));
+
+// And spawn our command and let us know if any errors occur
+require('safeps').spawn(command, {stdio:'inherit'}, function(err){
if (err) console.log(err);
});
View
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+
+// Prefix our docpad executable with the node debug and profile flags
+// and suffix docpad with it's profile flag
+var command = [
+ 'tracegl',
+ '-no:coffee-script',
+ __dirname+'/docpad',
+].concat(process.argv.slice(2));
+
+// Output the command we'll be running
+console.log(command.join(' '));
+
+// And spawn our command and let us know if any errors occur
+require('safeps').spawn(command, {stdio:'inherit'}, function(err){
+ if (err) console.log(err);
+});
View
@@ -152,6 +152,7 @@
consoleOptionForce: "force a re-install of all modules"
consoleOptionPort: "a custom port to use for the server <port>"
consoleOptionSkeleton: "for new projects, instead of being asked for the skeleton, you can specify it here"
+ consoleOptionProfile: "enable profiling"
# Misc
outPathConflict: """
View
@@ -1,6 +1,6 @@
{
"name": "docpad",
- "version": "6.40.0",
+ "version": "6.41.0",
"description": "DocPad is a language agnostic document management system. This means you write your website as documents, in whatever language you wish, and DocPad will handle the compiling, templates and layouts for you. For static documents it will generate static files, for dynamic documents it'll re-render them on each request. You can utilise DocPad by itself, or use it as a module your own custom system. It's pretty cool, and well worth checking out. We love it.",
"homepage": "https://github.com/bevry/docpad",
"installUrl": "http://docpad.org/install",
@@ -87,7 +87,7 @@
"progressbar": "~1.0.1",
"query-engine": "~1.5.2",
"safefs": "~3.0.1",
- "safeps": "~2.2.1",
+ "safeps": "~2.2.3",
"semver": "~2.0.7",
"superagent": "~0.14.6",
"taskgroup": "~3.1.2",
@@ -106,7 +106,9 @@
"coffee-script": "~1.6.2",
"chai": "~1.7.0",
"joe": "~1.2.0",
- "joe-reporter-console": "~1.2.1"
+ "joe-reporter-console": "~1.2.1",
+ "webkit-devtools-agent": "~0.1.1",
+ "nodetime": "~0.8.13"
},
"directories": {
"lib": "./out/lib"
@@ -115,7 +117,8 @@
"docpad": "./bin/docpad",
"docpad-compile": "./bin/docpad-compile",
"docpad-debug": "./bin/docpad-debug",
- "docpad-server": "./bin/docpad-server"
+ "docpad-server": "./bin/docpad-server",
+ "docpad-trace": "./bin/docpad-trace"
},
"scripts": {
"test": "./node_modules/.bin/cake test"
View
@@ -1,6 +1,29 @@
# =====================================
# Requires
+# Profile
+if ('--profile' in process.argv)
+ # Debug
+ debugger
+
+ # Nodetime
+ if process.env.NODETIME_KEY
+ try
+ require('nodetime').profile({
+ accountKey: process.env.NODETIME_KEY
+ appName: 'DocPad'
+ })
+ console.log('Profiling with nodetime')
+ catch err
+ # ignore
+
+ # Webkit Devtools
+ try
+ agent = require('webkit-devtools-agent')
+ console.log("Profiling with process id:", process.pid)
+ catch err
+ # ignore
+
# Necessary
pathUtil = require('path')
_ = require('lodash')
@@ -54,6 +54,10 @@ class ConsoleInterface
'-s, --skeleton <skeleton>'
locale.consoleOptionSkeleton
)
+ .option(
+ '--profile'
+ locale.consoleOptionProfile
+ )
# -----------------------------

0 comments on commit 13b4f0d

Please sign in to comment.