Package org.sonar.core.profiling

Examples of org.sonar.core.profiling.Profiling


    }
  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareExists(IndexDefinition.RULE.getIndexName()).get();
View Full Code Here


      .fetchSourceContext(FetchSourceContext.FETCH_SOURCE)).toString()).isEqualTo("ES multi get request [key 'ruleKey', index 'rules', type 'rule'],");
  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      MultiGetRequestBuilder request = searchClient.prepareMultiGet();
      request.add(new MultiGetRequest.Item(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexType(), "ruleKey")
View Full Code Here

    assertThat(searchClient.prepareCount().toString()).isEqualTo("ES count request");
  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareCount(IndexDefinition.RULE.getIndexName()).get();
View Full Code Here

  }

  @Test
  public void with_profiling_basic() {
    try {
      Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
      SearchClient searchClient = new SearchClient(new Settings(), profiling);
      SearchResponse search = searchClient.prepareSearch(IndexDefinition.RULE.getIndexName())
        .setSearchType(SearchType.SCAN)
        .setScroll(TimeValue.timeValueSeconds(3L))
        .get();
View Full Code Here

    assertThat(searchClient.prepareNodesStats().toString()).isEqualTo("ES nodes stats request");
  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      searchClient.prepareNodesStats().get();
View Full Code Here

    // Nothing
  }

  @VisibleForTesting
  Profiling getProfiling() {
    Profiling profiling = Platform.component(Profiling.class);
    if (profiling != null) {
      return profiling;
    }
    return new Profiling(new Settings());
  }
View Full Code Here

    MeasureFilterFactory factory = mock(MeasureFilterFactory.class);
    MeasureFilter filter = new MeasureFilter();
    when(factory.create(filterMap)).thenReturn(filter);
    MeasureFilterExecutor executor = mock(MeasureFilterExecutor.class);

    MeasureFilterEngine engine = new MeasureFilterEngine(factory, executor, new Profiling(new Settings()));

    final long userId = 50L;
    engine.execute(filterMap, userId);
    verify(executor).execute(refEq(filter), argThat(new BaseMatcher<MeasureFilterContext>() {
      public boolean matches(Object o) {
View Full Code Here

    Map<String, Object> filterMap = ImmutableMap.of("qualifiers", (Object) "TRK");
    MeasureFilterFactory factory = mock(MeasureFilterFactory.class);
    when(factory.create(filterMap)).thenThrow(new IllegalArgumentException());
    MeasureFilterExecutor executor = mock(MeasureFilterExecutor.class);

    MeasureFilterEngine engine = new MeasureFilterEngine(factory, executor, new Profiling(new Settings()));
    MeasureFilterResult result = engine.execute(filterMap, 50L);

    assertThat(result.isSuccess()).isFalse();
    assertThat(result.getError()).isEqualTo(MeasureFilterResult.Error.UNKNOWN);
    assertThat(result.getRows()).isNull();
View Full Code Here

  private JRubyProfiling profilingFacade;

  @Before
  public void initialize() {
    profilingFacade = new JRubyProfiling(new Profiling(new Settings()));
  }
View Full Code Here

    assertThat(searchClient.prepareRefresh().toString()).isEqualTo("ES refresh request");
  }

  @Test
  public void with_profiling_basic() {
    Profiling profiling = new Profiling(new Settings().setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.BASIC.name()));
    SearchClient searchClient = new SearchClient(new Settings(), profiling);

    try {
      RefreshRequestBuilder requestBuilder = searchClient.prepareRefresh(IndexDefinition.RULE.getIndexName());
      requestBuilder.get();
View Full Code Here

TOP

Related Classes of org.sonar.core.profiling.Profiling

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.