更新时间:2024-06-14 GMT+08:00
分享

查看OpenTSDB应用调测结果

操作场景

OpenTSDB样例程序运行完后,可直接通过运行结果查看应用程序运行情况,也可以通过运行日志获取应用运行情况。

操作步骤

  • 运行结果会有如下成功信息:
2019-06-27 14:05:20,713 INFO  [main] examples.OpentsdbExample: start to put data in opentsdb, the url is https://node-ana-corejnWt:4242/api/put/?sync&sync_timeout=60000
2019-06-27 14:05:23,680 INFO  [main] examples.OpentsdbExample: Status Code : 204
2019-06-27 14:05:23,680 INFO  [main] examples.OpentsdbExample: put data to opentsdb successfully.
2019-06-27 14:05:23,681 INFO  [main] examples.OpentsdbExample: start to query data in opentsdb, the url is https://node-ana-corejnWt:4242/api/query
2019-06-27 14:05:23,895 INFO  [main] examples.OpentsdbExample: Status Code : 200
2019-06-27 14:05:23,897 INFO  [main] examples.OpentsdbExample: Response content : [{"metric":"city.temp","tags":{"region":"Longgang","city":"Shenzhen"},"aggregateTags":[],"dps":{"1498838400":28.0,"1498842000":27.0,"1498845600":27.0,"1498849200":27.0,"1498852800":27.0,"1498856400":27.0,"1498860000":27.0,"1498863600":27.0,"1498867200":29.0,"1498870800":30.0,"1498874400":32.0,"1498878000":32.0,"1498881600":33.0,"1498885200":33.0,"1498888800":32.0,"1498892400":32.0,"1498896000":31.0,"1498899600":30.0,"1498903200":30.0,"1498906800":29.0,"1498910400":29.0,"1498914000":29.0,"1498917600":28.0,"1498921200":28.0}},{"metric":"city.hum","tags":{"region":"Longgang","city":"Shenzhen"},"aggregateTags":[],"dps":{"1498838400":54.0,"1498842000":53.0,"1498845600":52.0,"1498849200":51.0,"1498852800":50.0,"1498856400":49.0,"1498860000":48.0,"1498863600":46.0,"1498867200":46.0,"1498870800":48.0,"1498874400":48.0,"1498878000":49.0,"1498881600":49.0,"1498885200":50.0,"1498888800":50.0,"1498892400":50.0,"1498896000":51.0,"1498899600":51.0,"1498903200":51.0,"1498906800":51.0,"1498910400":52.0,"1498914000":53.0,"1498917600":54.0,"1498921200":54.0}}]
2019-06-27 14:05:23,897 INFO  [main] examples.OpentsdbExample: query data to opentsdb successfully.
2019-06-27 14:05:23,897 INFO  [main] examples.OpentsdbExample: start to delete data in opentsdb, the url is https://node-ana-corejnWt:4242/api/query
2019-06-27 14:05:24,112 INFO  [main] examples.OpentsdbExample: Status Code : 200
2019-06-27 14:05:24,112 INFO  [main] examples.OpentsdbExample: delete data to opentsdb successfully.
  • 日志说明

日志级别默认为INFO,可以通过调整日志打印级别(DEBUG,INFO,WARN,ERROR,FATAL)来显示更详细的信息。可以通过修改log4j.properties文件来实现,如:

# Define some default values that can be overridden by system properties
opentsdb.root.logger=INFO,console
# Define the root logger to the system property "opentsdb.root.logger".
log4j.rootLogger=${opentsdb.root.logger}
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n

相关文档