congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.sonar.process.systeminfo
Code IndexAdd Tabnine to your IDE (free)

How to use org.sonar.process.systeminfo

Best Java code snippets using org.sonar.process.systeminfo (Showing top 20 results out of 315)

origin: SonarSource/sonarqube

 private static void addAttributeInMb(ProtobufSystemInfo.Section.Builder protobuf, String key, long valueInBytes) {
  if (valueInBytes >= 0L) {
   setAttribute(protobuf, key, valueInBytes / MEGABYTE);
  }
 }
}
origin: SonarSource/sonarqube

 @Override
 protected void configureModule() {
  add(
   CeConfigurationImpl.class,
   CeTaskLogging.class,
   CeDatabaseMBeanImpl.class,
   new JvmStateSection("Compute Engine JVM State"),
   new JvmPropertiesSection("Compute Engine JVM Properties"),
   LoggingSection.class);
 }
}
origin: SonarSource/sonarqube

@Override
public ProtobufSystemInfo.Section toProtobuf() {
 return toProtobuf(ManagementFactory.getMemoryMXBean());
}
origin: SonarSource/sonarqube

@Override
public ProtobufSystemInfo.Section toProtobuf() {
 ProtobufSystemInfo.Section.Builder protobuf = ProtobufSystemInfo.Section.newBuilder();
 protobuf.setName("System");
 setAttribute(protobuf, "Server ID", server.getId());
 setAttribute(protobuf, "High Availability", true);
 setAttribute(protobuf, "External User Authentication", getExternalUserAuthentication());
 addIfNotEmpty(protobuf, "Accepted external identity providers", getEnabledIdentityProviders());
 addIfNotEmpty(protobuf, "External identity providers whose users are allowed to sign themselves up", getAllowsToSignUpEnabledIdentityProviders());
 setAttribute(protobuf, "Force authentication", getForceAuthentication());
 return protobuf.build();
}
origin: SonarSource/sonarqube

 public static ProtobufSystemInfo.SystemInfo provide() {
  ProtobufSystemInfo.SystemInfo.Builder protobuf = ProtobufSystemInfo.SystemInfo.newBuilder();
  if (instance != null) {
   instance.sections.forEach(section -> protobuf.addSections(section.toProtobuf()));
  }
  return protobuf.build();
 }
}
origin: SonarSource/sonarqube

@Test
public void index_attributes() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 // one index "issues"
 assertThat(attribute(section, "Index issues - Docs").getLongValue()).isEqualTo(0L);
 assertThat(attribute(section, "Index issues - Shards").getLongValue()).isGreaterThan(0);
 assertThat(attribute(section, "Index issues - Store Size").getStringValue()).isNotNull();
}
origin: SonarSource/sonarqube

 public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, long expectedValue) {
  ProtobufSystemInfo.Attribute value = attribute(section, key);
  assertThat(value).as(key).isNotNull();
  assertThat(value.getLongValue()).isEqualTo(expectedValue);
 }
}
origin: SonarSource/sonarqube

@Test
public void name_is_not_empty() {
 assertThat(underTest.toProtobuf().getName()).isEqualTo("Web JVM Properties");
}
origin: SonarSource/sonarqube

public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, String expectedValue) {
 ProtobufSystemInfo.Attribute value = attribute(section, key);
 assertThat(value).as(key).isNotNull();
 assertThat(value.getStringValue()).isEqualTo(expectedValue);
}
origin: SonarSource/sonarqube

public static void assertThatAttributeIs(ProtobufSystemInfo.Section section, String key, boolean expectedValue) {
 ProtobufSystemInfo.Attribute value = attribute(section, key);
 assertThat(value).as(key).isNotNull();
 assertThat(value.getBooleanValue()).isEqualTo(expectedValue);
}
origin: SonarSource/sonarqube

@Test
public void test_order() {
 Collection<Section> sections = asList(
  newSection("end2"),
  newSection("bar"),
  newSection("end1"),
  newSection("foo"));
 List<String> ordered = SystemInfoUtils.order(sections, "foo", "bar").stream()
  .map(Section::getName)
  .collect(Collectors.toList());
 assertThat(ordered).isEqualTo(asList("foo", "bar", "end1", "end2"));
}
origin: SonarSource/sonarqube

protected void writeSections(Collection<ProtobufSystemInfo.Section> sections, JsonWriter json) {
 SystemInfoUtils
  .order(sections, ORDERED_SECTION_NAMES)
  .forEach(section -> writeSection(section, json));
}
origin: SonarSource/sonarqube

@Test
public void node_attributes() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(attribute(section, "CPU Usage (%)")).isNotNull();
 assertThat(attribute(section, "Disk Available")).isNotNull();
 assertThat(attribute(section, "Store Size")).isNotNull();
}
origin: SonarSource/sonarqube

 @Test
 public void test_attributes() {
  ProtobufSystemInfo.Section section = underTest.toProtobuf();
  assertThat(attribute(section, "Nodes").getLongValue()).isGreaterThan(0);
  assertThat(attribute(section, "State").getStringValue()).isIn("RED", "YELLOW", "GREEN");
 }
}
origin: SonarSource/sonarqube

@Test
public void return_nb_of_processors() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(attribute(section, "Processors").getLongValue()).isGreaterThan(0);
}
origin: SonarSource/sonarqube

new JvmPropertiesSection("Web JVM Properties"),
new JvmStateSection("Web JVM State"),
DbSection.class,
DbConnectionSection.class,
origin: SonarSource/sonarqube

private void completePoolAttributes(Section.Builder protobuf) {
 setAttribute(protobuf, "Pool Active Connections", getPoolActiveConnections());
 setAttribute(protobuf, "Pool Max Connections", getPoolMaxActiveConnections());
 setAttribute(protobuf, "Pool Initial Size", getPoolInitialSize());
 setAttribute(protobuf, "Pool Idle Connections", getPoolIdleConnections());
 setAttribute(protobuf, "Pool Min Idle Connections", getPoolMinIdleConnections());
 setAttribute(protobuf, "Pool Max Idle Connections", getPoolMaxIdleConnections());
 setAttribute(protobuf, "Pool Max Wait (ms)", getPoolMaxWaitMillis());
 setAttribute(protobuf, "Pool Remove Abandoned", getPoolRemoveAbandoned());
 setAttribute(protobuf, "Pool Remove Abandoned Timeout (seconds)", getPoolRemoveAbandonedTimeoutSeconds());
}
origin: SonarSource/sonarqube

 @Test
 public void return_nb_of_processors() {
  ProtobufSystemInfo.Section protobuf = underTest.toProtobuf();
  assertThat(attribute(protobuf, "Processors").getLongValue()).isGreaterThan(0);
 }
}
origin: SonarSource/sonarqube

 private static void addIfNotEmpty(ProtobufSystemInfo.Section.Builder protobuf, String key, @Nullable List<String> values) {
  if (values != null && !values.isEmpty()) {
   setAttribute(protobuf, key, COMMA_JOINER.join(values));
  }
 }
}
origin: SonarSource/sonarqube

private static void addIfNotEmpty(ProtobufSystemInfo.Section.Builder protobuf, String key, @Nullable List<String> values) {
 if (values != null && !values.isEmpty()) {
  setAttribute(protobuf, key, COMMA_JOINER.join(values));
 }
}
org.sonar.process.systeminfo

Most used classes

  • ProtobufSystemInfo$Section
  • ProtobufSystemInfo$Section$Builder
  • ProtobufSystemInfo$SystemInfo
  • SystemInfoUtils
  • ProtobufSystemInfo$Attribute
  • JvmPropertiesSection,
  • SystemInfoSection,
  • ProtobufSystemInfo$SystemInfo$Builder,
  • ProtobufSystemInfo$Attribute$Builder,
  • SystemInfoUtilsTest
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now