[ 
https://issues.apache.org/jira/browse/HIVE-19902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540189#comment-16540189
 ] 

Owen O'Malley commented on HIVE-19902:
--------------------------------------

[~akolb], thanks for the answers.

JMH does provide the functionality for benchmark setup/teardown. It looks like:

{code}
@BenchmarkMode(Mode.AverageTime)
@Warmup(iterations=2 time=5, timeUnit = TimeUnit.SECONDS) // 2 iterations of 5 
seconds each
@Measurement(iterations=10, time=5, timeUnit = TimeUnit.SECONDS) // 10 
iterations of 5 seconds each
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@Fork(1)
public class MetastoreBenchmarks {
   @State(Scope.Thread)
   public static class MyState {
        ... variables and parameters that benchmarks need ...

        @Setup(Level.Trial)
        public void setup() {
          .. unmeasured setup code ...
        }

        @TearDown(Level.Trial)
        public void teardown() {
            ... unmeasured teardown code ...
        }
    }

    @Benchmark
    public void testMethod(MyState state) {
        ... code to be benchmarked ....
    }
}
{code}

> Provide Metastore micro-benchmarks
> ----------------------------------
>
>                 Key: HIVE-19902
>                 URL: https://issues.apache.org/jira/browse/HIVE-19902
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>    Affects Versions: 3.1.0, 4.0.0
>            Reporter: Alexander Kolbasov
>            Assignee: Alexander Kolbasov
>            Priority: Major
>         Attachments: HIVE-19902.01.patch, HIVE-19902.02.patch, 
> HIVE-19902.03.patch, HIVE-19902.04.patch
>
>
> It would be very useful to have metastore benchmarks to be able to track perf 
> issues.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to