Package org.sonar.core.profiling

Examples of org.sonar.core.profiling.Profiling


  @Rule
  public TemporaryFolder temporaryFolder = new TemporaryFolder();

  @Before
  public void setUp() throws Exception {
    localDatabaseFactory = new PreviewDatabaseFactory(getDatabase(), new Profiling(new Settings()));
  }
View Full Code Here


  }

  private BasicDataSource createDatabase(byte[] db) throws IOException {
    File file = temporaryFolder.newFile("db.h2.db");
    Files.write(db, file);
    return new DbTemplate(new Profiling(new Settings())).dataSource("org.h2.Driver", "sonar", "sonar", "jdbc:h2:" + file.getAbsolutePath().replaceAll(".h2.db", ""));
  }
View Full Code Here

  private final Profiling profiling;

  SqlProfiling() {
    Settings settings = new Settings();
    settings.setProperty(Profiling.CONFIG_PROFILING_LEVEL, Profiling.Level.FULL.toString());
    profiling = new Profiling(settings);
  }
View Full Code Here

public class SearchClient extends TransportClient implements Startable {

  private final Profiling profiling;

  public SearchClient(Settings settings) {
    this(settings, new Profiling(settings));
  }
View Full Code Here

    assertThat(searchClient.prepareDeleteByQuery().toString()).isEqualTo("ES delete by query 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.prepareDeleteByQuery(IndexDefinition.RULE.getIndexName()).setQuery(QueryBuilders.matchAllQuery()).get();
View Full Code Here

    assertThat(searchClient.prepareClusterStats().toString()).isEqualTo("ES cluster 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 {
      ClusterStatsRequestBuilder requestBuilder = searchClient.prepareClusterStats();
      requestBuilder.get();
View Full Code Here

    assertThat(searchClient.prepareFlush().toString()).isEqualTo("ES flush 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.prepareFlush(IndexDefinition.RULE.getIndexName()).get();
View Full Code Here

      .contains("[Action 'IndexRequest' for key 'rule1' on index 'rules' on type 'rules'],");
  }

  @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);

    BulkRequestBuilder bulkRequestBuilder = searchClient.prepareBulk();
    bulkRequestBuilder.add(new UpdateRequest(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexName(), "rule1").doc(Collections.emptyMap()));
    bulkRequestBuilder.add(new DeleteRequest(IndexDefinition.RULE.getIndexName(), IndexDefinition.RULE.getIndexName(), "rule1"));
View Full Code Here

    assertThat(searchClient.prepareSearch().toString()).contains("ES search 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.prepareSearch(IndexDefinition.RULE.getIndexName()).get();
View Full Code Here

    when(filterConfig.getServletContext()).thenReturn(context);
    chain = mock(FilterChain.class);

    Settings settings = new Settings();
    settings.setProperty("sonar.log.profilingLevel", "BASIC");
    Profiling profiling = new Profiling(settings);

    filter = spy(new ProfilingFilter());
    when(filter.getProfiling()).thenReturn(profiling);
    filter.init(filterConfig);
  }
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.