@Override
  public Map<String, String> getUdcParams() {
    String classPath = getClassPath();

    Map<String, String> udcFields = new HashMap<>();

    add(udcFields, ID, storeId);
    add(udcFields, VERSION, filterVersionForUDC(kernel.version().getReleaseVersion()));
    add(udcFields, REVISION, filterVersionForUDC(kernel.version().getRevision()));

    add(udcFields, EDITION, determineEdition(classPath));
    add(udcFields, TAGS, determineTags(jarNamesForTags, classPath));
    add(udcFields, CLUSTER_HASH, determineClusterNameHash());
    add(udcFields, SOURCE, config.get(UdcSettings.udc_source));
    add(udcFields, REGISTRATION, config.get(UdcSettings.udc_registration_key));
    add(udcFields, DISTRIBUTION, determineOsDistribution());
    add(udcFields, USER_AGENTS, determineUserAgents());

    add(udcFields, MAC, determineMacAddress());
    add(udcFields, NUM_PROCESSORS, determineNumberOfProcessors());
    add(udcFields, TOTAL_MEMORY, determineTotalMemory());
    add(udcFields, HEAP_SIZE, determineHeapSize());

    add(udcFields, NODE_IDS_IN_USE, determineNodesIdsInUse());
    add(udcFields, RELATIONSHIP_IDS_IN_USE, determineRelationshipIdsInUse());
    add(udcFields, LABEL_IDS_IN_USE, determineLabelIdsInUse());
    add(udcFields, PROPERTY_IDS_IN_USE, determinePropertyIdsInUse());

    udcFields.putAll(determineSystemProperties());
    return udcFields;
  }
예제 #2
0
 private GraphDatabaseShellServer loadShell(KernelData kernel, ShellBootstrap bootstrap) {
   try {
     return bootstrap.load(kernel.graphDatabase());
   } catch (RemoteException cause) {
     throw new RuntimeException("Could not load remote shell", cause);
   }
 }
  public DefaultUdcInformationCollector(
      Config config,
      XaDataSourceManager xadsm,
      @SuppressWarnings("deprecation") KernelData kernel) {
    this.config = config;
    this.kernel = kernel;
    nodeManager =
        kernel.graphDatabase().getDependencyResolver().resolveDependency(NodeManager.class);

    if (xadsm != null) {
      xadsm.addDataSourceRegistrationListener(
          new DataSourceRegistrationListener() {
            @Override
            public void registeredDataSource(XaDataSource ds) {
              if (ds instanceof NeoStoreXaDataSource) {
                crashPing = ds.getXaContainer().getLogicalLog().wasNonClean();
                storeId = Long.toHexString(ds.getRandomIdentifier());
              }
            }

            @Override
            public void unregisteredDataSource(XaDataSource ds) {
              if (ds instanceof NeoStoreXaDataSource) {
                crashPing = false;
                storeId = null;
              }
            }
          });
    }
  }