本文整理了Java中io.opencensus.contrib.zpages.ZPageHandlers
类的一些代码示例,展示了ZPageHandlers
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZPageHandlers
类的具体详情如下:
包路径:io.opencensus.contrib.zpages.ZPageHandlers
类名称:ZPageHandlers
[英]A collection of HTML pages to display stats and trace data and allow library configuration control.
Example usage with private HttpServer:
public class Main }
}
Example usage with shared HttpServer:
public class Main }
}
[中]一组HTML页面,用于显示统计数据和跟踪数据,并允许库配置控制。
私有HttpServer的使用示例:
public class Main }
}
共享HttpServer的使用示例:
public class Main }
}
代码示例来源:origin: GoogleCloudPlatform/java-docs-samples
ZPageHandlers.startHttpServerAndRegisterAll(8080);
代码示例来源:origin: census-instrumentation/opencensus-java
checkState(server == null, "The HttpServer is already started.");
server = HttpServer.create(new InetSocketAddress(port), BACKLOG);
ZPageHandlers.registerAllToHttpServer(server);
server.start();
logger.fine("HttpServer started on address " + server.getAddress().toString());
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void implementationOfTraceConfigz() {
assertThat(ZPageHandlers.getTraceConfigzZPageHandler())
.isInstanceOf(TraceConfigzZPageHandler.class);
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void implementationOfTracez() {
assertThat(ZPageHandlers.getTracezZPageHandler()).isInstanceOf(TracezZPageHandler.class);
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void implementationOfStatsz() {
assertThat(ZPageHandlers.getStatszZPageHandler()).isInstanceOf(StatszZPageHandler.class);
}
}
代码示例来源:origin: census-instrumentation/opencensus-java
@Test
public void implementationOfRpcz() {
assertThat(ZPageHandlers.getRpczZpageHandler()).isInstanceOf(RpczZPageHandler.class);
}
代码示例来源:origin: GoogleCloudPlatform/cloud-bigtable-examples
public static void main(String[] args) throws IOException, InterruptedException {
// Consult system properties to get project/instance
String projectId = requiredProperty("bigtable.projectID");
String instanceId = requiredProperty("bigtable.instanceID");
// Force tracing for every request for demo purposes. Use the default settings
// in most cases.
Tracing.getTraceConfig().updateActiveTraceParams(
TraceParams.DEFAULT.toBuilder().setSampler(Samplers.probabilitySampler(1)).build());
StackdriverTraceExporter.createAndRegister(
StackdriverTraceConfiguration.builder()
.setProjectId(projectId)
.build());
// Enable stats exporter to Stackdriver with a 5 second export time.
// Production settings may vary.
StackdriverStatsExporter.createAndRegister(
StackdriverStatsConfiguration.builder()
.setProjectId(projectId)
.setExportInterval(Duration.create(5, 0))
.build());
RpcViews.registerAllViews();
// HBase Bigtable specific setup for zpages
HBaseTracingUtilities.setupTracingConfig();
// Start a web server on port 8080 for tracing data
ZPageHandlers.startHttpServerAndRegisterAll(8080);
doHelloWorld(projectId, instanceId);
System.out.println("Sleeping for 1 minute so that you can view http://localhost:8080/tracez");
// Sleep for 1 minute.
Thread.sleep(TimeUnit.MINUTES.toMillis(1));
}
内容来源于网络,如有侵权,请联系作者删除!