Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
github.com/perfectcarl/play-profiler
h1. profiler
The @profiler@ module is a simple but effective mini-profiler for @Play 1.2@ and @1.3@.
A demo is "available":http://play-profiler.appspot.com (the complete source code is available at "github":https://github.com/PerfectCarl/play-profiler-demo-gae)
!https://raw.githubusercontent.com/PerfectCarl/play-profiler/master/documentation/manual/profiler.PNG!
This project is heavily inspired from "mini-profiler":http://miniprofiler.com/ and java implementation done by alvin's "java-mini-profiler":https://github.com/alvins82/java-mini-profiler-core and
h2. Features
h3. Server side calls
The module logs the duration for the following:
h3. Ajax calls
The module logs the subsequent Ajax calls:
h3. Play internal monitoring
The module displays Play internal monitor statistics (querying "Jamon":http://jamonapi.sourceforge.net/ data).
h3. Custom code profiling
You may profile your own code using @MiniProfiler@ class.
bc.. import play.modules.profiler.MiniProfiler; import play.modules.profiler.Step; ...
public static void custom() {
step = MiniProfiler.step("database", "DB calls");
List result;
try {
result = Data.findAll();
} finally {
step.close();
}
render(result);
}
h3. Supports Google App Engine
The profiler works with Google App Engine which hosts the "demo":http://play-profiler.appspot.com
h2. Getting started
Add the module to your application:
bc. require:
- play
- carl -> profiler 0.6.9.3
repositories:
- githubModules:
type: http
artifact: "https://github.com/PerfectCarl/play-[module]/raw/master/dist/[module]-[revision].zip"
contains:
- carl -> *
Then include the profiler's css and javascript resources in your root template file(likely @main.html@) :
bc.
...
${profiler.styles.raw()}
...
${profiler.scripts.raw()}
h2. Sample application
A "complete sample":https://github.com/PerfectCarl/play-profiler/tree/master/sample is available demonstrating the use of the module.
h2. How to build
bc. play deps play build-module
The zip file is created in the @dist@ folder.
Then open the zip file created in the @dist/@ folder and delete the following:
h2. "Changelog":https://github.com/PerfectCarl/play-profiler/blob/master/CHANGELOG.textile
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.