> On Nov. 30, 2016, 6:03 p.m., Mehrdad Nurolahzade wrote: > > src/main/java/org/apache/aurora/scheduler/storage/db/InstrumentingInterceptor.java, > > line 59 > > <https://reviews.apache.org/r/54107/diff/4/?file=1572788#file1572788line59> > > > > There is also a `queryCursor()` call. Is there any particular reason > > for excluding it?
Not really. A question though! Given that it only returns a cursor, not sure if those invocations would be very slow? I add them now, as I don't feel strongly about it. > On Nov. 30, 2016, 6:03 p.m., Mehrdad Nurolahzade wrote: > > src/main/java/org/apache/aurora/scheduler/storage/db/InstrumentingInterceptor.java, > > lines 113-115 > > <https://reviews.apache.org/r/54107/diff/4/?file=1572788#file1572788line113> > > > > Nit: This logic can be moved to `finally` block. > > > > On the very off chance of this being slow or causing an exception, it > > would still gurantee the invocation is made. make sense. > On Nov. 30, 2016, 6:03 p.m., Mehrdad Nurolahzade wrote: > > src/test/java/org/apache/aurora/scheduler/storage/db/InstrumentingInterceptorTest.java, > > lines 71-72 > > <https://reviews.apache.org/r/54107/diff/4/?file=1572789#file1572789line71> > > > > Nit: Expectations can also be cascaded, like > > `expect(clock.nowNanos()).andReturn(0L).andReturn(1000L);` done. - Reza ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54107/#review157427 ----------------------------------------------------------- On Nov. 30, 2016, 6:14 a.m., Reza Motamedi wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54107/ > ----------------------------------------------------------- > > (Updated Nov. 30, 2016, 6:14 a.m.) > > > Review request for Aurora, David McLaughlin, Joshua Cohen, Mehrdad > Nurolahzade, and Santhosh Kumar Shanmugham. > > > Repository: aurora > > > Description > ------- > > MyBatis allows us to intercept calls within the execution of a mapped > statement. This allows us to time various mapped statements and ultimately > gain more insight on the performance of the database module. > > This patch introduces an interceptor on MyBatis on `updates` and `query` > mapped statements. I used the following convention to create name for the > newly collected stats: > mybatis.<<the id of the mapped statement>> > > After interception the process is very similar to the one in > @Timed-interceptor. SlidingStats can be used to export interval averages, > total milliseconds and the event counts. > > __example stats (from ./vars.json)__ > mybatis.create_tables_events 1 > mybatis.create_tables_events_per_sec 0.0 > mybatis.create_tables_nanos_per_event 0.0 > mybatis.create_tables_nanos_total 592633784 > mybatis.create_tables_nanos_total_per_sec 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.selectAll_events > 3 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.selectAll_events_per_sec > 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.selectAll_nanos_per_event > 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.selectAll_nanos_total > 2858362 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.selectAll_nanos_total_per_sec > 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.select_events > 333 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.select_events_per_sec > 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.select_nanos_per_event > 0.0 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.select_nanos_total > 85745680 > mybatis.org.apache.aurora.scheduler.storage.db.AttributeMapper.select_nanos_total_per_sec > 0.0 > > > Diffs > ----- > > src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java > e7287cec28e7b8ca978c506bfe821f261bc0ac26 > > src/main/java/org/apache/aurora/scheduler/storage/db/InstrumentingInterceptor.java > PRE-CREATION > > src/test/java/org/apache/aurora/scheduler/storage/db/InstrumentingInterceptorTest.java > PRE-CREATION > > src/test/java/org/apache/aurora/scheduler/storage/mem/InMemTaskStoreTest.java > 2e560c0d565689703b282391fe49dbf213ee25dc > > src/test/java/org/apache/aurora/scheduler/storage/mem/MemCronJobStoreTest.java > 79999e19454568540c14f91808635bf8dff82bb3 > > Diff: https://reviews.apache.org/r/54107/diff/ > > > Testing > ------- > > Tests are covered in InstrumentingInterceptorTest. > > - testStatIsCreatedOnce > Tests that each stat is created one time only. > > - testInterceptMarksMetrics > Tests that invocation is correctly intercepted and then proceeds. > > > Thanks, > > Reza Motamedi > >
