use of com.orientechnologies.common.profiler.OAbstractProfiler.OProfilerHookValue in project orientdb by orientechnologies.
the class OServer method startupFromConfiguration.
public OServer startupFromConfiguration() throws IllegalArgumentException, SecurityException, InvocationTargetException, NoSuchMethodException, IOException {
OLogManager.instance().info(this, "OrientDB Server v" + OConstants.getVersion() + " is starting up...");
Orient.instance();
if (startupLatch == null)
startupLatch = new CountDownLatch(1);
if (shutdownLatch == null)
shutdownLatch = new CountDownLatch(1);
clientConnectionManager = new OClientConnectionManager(this);
initFromConfiguration();
if (OGlobalConfiguration.ENVIRONMENT_DUMP_CFG_AT_STARTUP.getValueAsBoolean()) {
System.out.println("Dumping environment after server startup...");
OGlobalConfiguration.dumpConfiguration(System.out);
}
dbPoolFactory = new OPartitionedDatabasePoolFactory();
dbPoolFactory.setMaxPoolSize(contextConfiguration.getValueAsInteger(OGlobalConfiguration.DB_POOL_MAX));
databaseDirectory = contextConfiguration.getValue("server.database.path", serverRootDirectory + "/databases/");
databaseDirectory = OFileUtils.getPath(OSystemVariableResolver.resolveSystemVariables(databaseDirectory));
databaseDirectory = databaseDirectory.replace("//", "/");
// CONVERT IT TO ABSOLUTE PATH
databaseDirectory = (new File(databaseDirectory)).getCanonicalPath();
databaseDirectory = OFileUtils.getPath(databaseDirectory);
if (!databaseDirectory.endsWith("/"))
databaseDirectory += "/";
OLogManager.instance().info(this, "Databases directory: " + new File(databaseDirectory).getAbsolutePath());
Orient.instance().getProfiler().registerHookValue("system.databases", "List of databases configured in Server", METRIC_TYPE.TEXT, new OProfilerHookValue() {
@Override
public Object getValue() {
final StringBuilder dbs = new StringBuilder(64);
for (String dbName : getAvailableStorageNames().keySet()) {
if (dbs.length() > 0)
dbs.append(',');
dbs.append(dbName);
}
return dbs.toString();
}
});
return this;
}
use of com.orientechnologies.common.profiler.OAbstractProfiler.OProfilerHookValue in project orientdb by orientechnologies.
the class OAbstractRecordCache method startup.
/**
* All operations running at cache initialization stage
*/
public void startup() {
underlying.startup();
Orient.instance().getProfiler().registerHookValue(profilerPrefix + "current", "Number of entries in cache", METRIC_TYPE.SIZE, new OProfilerHookValue() {
public Object getValue() {
return getSize();
}
}, profilerMetadataPrefix + "current");
}
use of com.orientechnologies.common.profiler.OAbstractProfiler.OProfilerHookValue in project orientdb by orientechnologies.
the class OChannel method connected.
public void connected() {
final String dictProfilerMetric = PROFILER.getProcessMetric("network.channel.binary.*");
profilerMetric = PROFILER.getProcessMetric("network.channel.binary." + socket.getRemoteSocketAddress().toString() + ":" + socket.getLocalPort() + "".replace('.', '_'));
PROFILER.registerHookValue(profilerMetric + ".transmittedBytes", "Bytes transmitted to a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() {
public Object getValue() {
return metricTransmittedBytes;
}
}, dictProfilerMetric + ".transmittedBytes");
PROFILER.registerHookValue(profilerMetric + ".receivedBytes", "Bytes received from a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() {
public Object getValue() {
return metricReceivedBytes;
}
}, dictProfilerMetric + ".receivedBytes");
PROFILER.registerHookValue(profilerMetric + ".flushes", "Number of times the network channel has been flushed", METRIC_TYPE.COUNTER, new OProfilerHookValue() {
public Object getValue() {
return metricFlushes;
}
}, dictProfilerMetric + ".flushes");
}
Aggregations