/** * Constructor for log-telemetry * @param inputFilePath The input path for the file to be logged * @param port The port on which telemetry will run * @param out An appendable in which the specified file gets written to */ public LogTelemetry (String logFilePath) { // Add edges and pipes populateGraph(gm, "127.0.0.1", 8099, logFilePath); // Turning on the telemetry web page is as simple as adding this line // It will be accessible on the most public IP it can find by default gm.enableTelemetry("127.0.0.1",8098); }
public static void main(String[] args) { String home = System.getenv().get("HOME"); String filesPath = MainArgs.getOptArg("files", "-f", args, (null==home?"~":home)+"/www"); String host = MainArgs.getOptArg("host", "-h", args, null); int port = Integer.valueOf(MainArgs.getOptArg("port", "-p", args, "8080")); GraphManager gm = new GraphManager(); populateGraph(gm, host, port, filesPath); gm.enableTelemetry(8089); StageScheduler.defaultScheduler(gm).startup(); }
public static GreenRuntime run(GreenApp app, String[] args, Runnable cleanShutdown, Runnable dirtyShutdown ) { GreenRuntime runtime = new GreenRuntime(args, app.getClass().getSimpleName()); app.declareConfiguration((GreenFramework)runtime.getBuilder()); GraphManager.addDefaultNota(runtime.gm, GraphManager.SCHEDULE_RATE, runtime.builder.getDefaultSleepRateNS()); runtime.declareBehavior(app); runtime.builder.buildStages(runtime); //runtime.logStageScheduleRates(); TelemetryConfig telemetryConfig = runtime.builder.getTelemetryConfig(); if (telemetryConfig != null) { //telemetryHost is not null only when we are running the HTTP telemetry server runtime.telemetryHost = runtime.gm.enableTelemetry(telemetryConfig.getHost(), telemetryConfig.getPort()); } runtime.setScheduler(runtime.builder.createScheduler(runtime,cleanShutdown,dirtyShutdown)); System.out.println("To exit app press Ctrl-C"); System.gc(); runtime.getScheduler().startup(); return runtime; }