Giter Club home page Giter Club logo

grails-miniprofiler's People

Contributors

bohdandan avatar tomdcc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

grails-miniprofiler's Issues

Lock wait timeout exceeded

Tha combination below is creates a lock in mysql:

class NewDomainClass {
def newService
def afterInsert = {
NewDomainClass.withNewSession {
new PrettyNewDomainClass(ndc: this).save(flush: true)
}
}
}
class PrettyNewDomainClass {
NewDomainClass ndc
}
class NewService {
static transactional = true
def add() {
new NewDomainClass().save()
}
}

newService.add() call from a controller for example generates
Lock wait timeout exceeded; try restarting transaction. Stacktrace follows:
Message: Lock wait timeout exceeded; try restarting transaction
Line | Method
->> 1078 | createSQLException in com.mysql.jdbc.SQLError


| 4120 | checkErrorPacket in com.mysql.jdbc.MysqlIO
| 4052 | checkErrorPacket . in ''
| 2503 | sendCommand in ''
| 2664 | sqlQueryDirect . . in ''
| 2815 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2155 | executeInternal . in com.mysql.jdbc.PreparedStatement
| 2458 | executeUpdate in ''
| 2375 | executeUpdate . . in ''
| 2359 | executeUpdate in ''
| 1021 | executeUpdate . . in net.sf.log4jdbc.PreparedStatementSpy

MissingPropertyException on Spring Security authentication failure

Relevant plugins:
runtime ':profiler:0.5-SNAPSHOT'
runtime ':miniprofiler:0.2'
compile ":spring-security-core:1.2.7.3"
compile ":spring-security-ldap:1.0.6"

Entered the wrong password and instead of being redirected(?) to the login page with a flash message telling me that the username/password combination is invalid, I received this exception:

groovy.lang.MissingPropertyException: g
at ProfilerGrailsPlugin$_processController_closure4.doCall(ProfilerGrailsPlugin.groovy:171)
at LoginController$_closure6.doCall(LoginController.groovy:108)
at com.linkedin.grails.profiler.ProfilerFilter.doFilterInternal(ProfilerFilter.java:82)
at com.energizedwork.miniprofiler.MiniProfilerFilter.doFilterInternal(MiniProfilerFilter.java:37)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)

More info:

Error 500: Internal Server Error

URI
/assetManagement/login/authfail
Class
groovy.lang.MissingPropertyException
Message
g

Around line 108 of grails-app/controllers/LoginController.groovy

105: msg = g.message(code: "springSecurity.errors.login.locked")106: }107: else {108: msg = g.message(code: "springSecurity.errors.login.fail")109: }110: }111:

Around line 82 of ProfilerFilter.java

79: // Pass execution on to the next filter.80: ProfilerFilterResponse filterResponse = new ProfilerFilterResponse(response);81: try {82: filterChain.doFilter(request, filterResponse);83: }84: finally {85: // End time.

Around line 37 of MiniProfilerFilter.java

34: miniProfiler = profilerProvider.start(ProfileLevel.Info);35: httpServletResponse.addHeader("X-MiniProfiler-Ids", "["" + miniProfiler.getId().toString() + ""]");36: }37: filterChain.doFilter(httpServletRequest, httpServletResponse);38: } finally {39: if(miniProfiler != null) {40: miniProfiler.stop();

The grails-app doesn't start when mongodb plugin is installed with transactional mongo services

Hi,

you're plugin is AWESOME :-). I was in your talk last GGX 2012 but I couldn't try the plugin because it wasn't compatible with Grails 2.1.X. Now I've tried it and it's really cool.

There is a problem if the grails application uses mongdb plugin with transactional mongo services.

I've some services with:
static transactional = 'mongo'

And during my app startup I've got the following error:

Configuring Spring Security Core ...
... finished configuring Spring Security Core
2013-08-15 13:26:35.530 ERROR GrailsContextLoader:213 - Error executing bootstraps: Error creating bean with name 'userDynDataService': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [org.springframework.aop.framework.ProxyFactoryBean]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDynDataService': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [org.springframework.aop.framework.ProxyFactoryBean]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [org.springframework.aop.framework.ProxyFactoryBean]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    ... 5 more

If I comment out the line static transaction = 'mongo' in userDynDataService the app starts ok.

Regards, Iván.

Add support for multiple data sources

Currently miniprofiler is enabled only for default data source. It will be great to add support for all data sources present in application.

After quick inspection of plugin source, I modified MiniprofilerGrailsPlugin.groovy and, in doWithSpring closure, replaced

BeanConfiguration dataSourceConfig = springConfig.getBeanConfig('dataSource')
if(dataSourceConfig) {
    springConfig.addBeanConfiguration("dataSourceOriginal", dataSourceConfig)
    dataSource(ProfilingDataSource, ref('dataSourceOriginal'), profilerProvider)
}

with

List<String> dataSourceBeanNames = springConfig.getBeanNames().findAll { it.startsWith("dataSource") && it.indexOf("Unproxied") == -1}
dataSourceBeanNames.each { String dataSourceBeanName ->
  BeanConfiguration dataSourceConfiguration = springConfig.getBeanConfig(dataSourceBeanName)
  if (dataSourceConfiguration) {
    springConfig.addBeanConfiguration("${dataSourceBeanName}_Original", dataSourceConfiguration)
    "${dataSourceBeanName}"(ProfilingDataSource, ref("${dataSourceBeanName}_Original"), profilerProvider)
  }
}

With this change only, I was able to get sql profiling for all data sources available in app.

Add support for profiling AJAX requests

The miniprofiler's namesake supports AJAX request timings. With dynamic apps, this can be a non-trivial amount of requests that could use the miniprofiler to help with performance tuning.

Getting MissingMethodException when building the plugin

Hi there,
I'm getting the following exception when trying the build the plugin.

Error generating web.xml file (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
groovy.lang.MissingMethodException: No signature of method:
groovy.xml.dom.DOMCategory$NodesHolder.putAt() is applicable for argument types:
(java.lang.Integer, java.lang.String) values:[0,com.energizedwork.miniprofiler.ProfilingGrailsPageFilter]
Possible solutions: putAt(java.lang.String, java.lang.Object), getAt(java.lang.String), wait(), dump(), item(int), print(java.io.PrintWriter)
   at MiniprofilerGrailsPlugin$_closure1.doCall(MiniprofilerGrailsPlugin.groovy:68)
   at _GrailsPackage_groovy$_run_closure5_closure10.doCall(_GrailsPackage_groovy:121)
   at _GrailsPackage_groovy$_run_closure5_closure10.doCall(_GrailsPackage_groovy)
   at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
   at _GrailsPackage_groovy$_run_closure5.doCall(_GrailsPackage_groovy:119)
   at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
   at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
   at rg.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
   at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
...

I could get rid of the exception but then it appears not updating the web.xml file at all (and consequently failing on Spring injections).

Would be nice if you could have a look at this.

Ondrej

getting profiler working on 2.2

I know it's not your plugin exactly, but I got this working on Grails 2.2 this morning by modifying the profiler plugin as depicted in the attached file.

In the main plugin file, add some ? to beanConfig and beanDefinition on line 85 (and I think on 86/87 just to be safe?)

then in the 'else' section below that, add a 'if(beanConfig)' block to skip that code if the beanConfig is null.

Screen shot 2012-12-22 at 1 11 34 PM

The profiler plugin is not on github or in any version control I can submit a patch to. :/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.