我在同一台机器上安装了 WSO2 AM 和 DAS,并为 DAS 服务器设置了偏移量 3 ( 3)。但在 api 管理器中看不到统计信息仪表板。
配置分析:
DAS 仅以 5 分钟的间隔汇总统计信息。例如:10:00, 10:05, 10:10, ...(一天中的固定间隔)。因此,直到前 5 分钟过去(如果当前时间是 10:03,它将发生在 10:05),汇总表将不会在 DAS 中创建,并且发布者/存储在此期间无法检索该信息,因此默认将显示图像。在该时间段之后,您将能够看到前 5 分钟间隔内的统计信息。下一次更新将在另外 5 分钟后发生,因此您在前 5 分钟后执行的 API 调用将在另外 5 分钟后包含在统计信息中,依此类推。因此,您应该能够在每 5 分钟间隔后看到更新的 API 使用汇总统计信息。
您可以通过登录 DAS 管理控制台验证数据是否已发布到 DAS,转到主选项卡中的数据资源管理器。然后选择表:ORG_WSO2_APIMGT_STATISTICS_REQUEST。您将能够看到您发送的所有 API 请求的信息。经过 5 分钟的时间间隔后,您应该也可以看到 API_VERSION_USAGE_SUMMARY 表,该表存储了发布者和商店从中检索该信息的汇总使用数据。您能否在 DAS 节点中验证它们。
请按照以下步骤操作。由于这一步已经完成,跳过它。
TID: [-1234] [] [2016-08-05 10:28:56,803] INFO {org.wso2.carbon.application.deployer.internal.ApplicationManager} - Deploying Carbon Application : API_Manager_Analytics_REST.car... {org.wso2.carbon.application.deployer.internal.ApplicationManager}
TID: [-1234] [] [2016-08-05 10:28:57,275] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org_wso2_apimgt_statistics_destination:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,278] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org.wso2.apimgt.statistics.fault:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,280] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org.wso2.apimgt.statistics.request:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,281] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org.wso2.apimgt.statistics.response:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,282] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org.wso2.apimgt.statistics.workflow:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,282] INFO {org.wso2.carbon.event.stream.core.EventStreamDeployer} - Stream definition is deployed successfully : org.wso2.apimgt.statistics.throttle:1.0.0 {org.wso2.carbon.event.stream.core.EventStreamDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,291] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_destination {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,292] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org_wso2_apimgt_statistics_destination:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,292] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_destination {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,293] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_fault {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,293] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org.wso2.apimgt.statistics.fault:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,293] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_fault {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,294] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_request {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,294] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org.wso2.apimgt.statistics.request:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,294] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_request {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,294] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_response {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,295] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org.wso2.apimgt.statistics.response:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,295] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_response {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,295] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_workflow {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,295] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org.wso2.apimgt.statistics.workflow:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,295] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_workflow {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,296] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver EventReceiver_throttle {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime}
TID: [-1234] [] [2016-08-05 10:28:57,296] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:org.wso2.apimgt.statistics.throttle:1.0.0 {org.wso2.carbon.event.stream.core.internal.EventJunction}
TID: [-1234] [] [2016-08-05 10:28:57,296] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: EventReceiver_throttle {org.wso2.carbon.event.receiver.core.EventReceiverDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,299] INFO {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer} - Deploying spark script: APIM_STAT_SCRIPT.xml for tenant : -1234 {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,366] INFO {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager} - Task scheduled: [-1234][ANALYTICS_SPARK][APIM_STAT_SCRIPT] {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager}
TID: [-1234] [] [2016-08-05 10:28:57,367] INFO {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer} - Deploying spark script: APIM_STAT_SCRIPT_THROTTLE.xml for tenant : -1234 {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer}
TID: [-1234] [] [2016-08-05 10:28:57,394] INFO {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager} - Task scheduled: [-1234][ANALYTICS_SPARK][APIM_STAT_SCRIPT_THROTTLE] {org.wso2.carbon.ntask.core.impl.AbstractQuartzTaskManager}
TID: [-1234] [] [2016-08-05 10:28:57,396] INFO {org.wso2.carbon.application.deployer.internal.ApplicationManager} - Successfully Deployed Carbon Application : APIM_STAT_CAPP_v1.0.3 {super-tenant} {org.wso2.carbon.application.deployer.internal.ApplicationManager}
转到 DAS 上的数据浏览器窗口,并确保您在下拉列表中看到表格。
重新启动 DAS 服务器以清除内存中保存的信息。
发布一些统计信息(调用 API)
等待一段时间,让分析脚本运行。如果您需要手动运行它们,请导航到 main -> Batch Analytics -> Scripts 并执行它们。
通过 API Manager 发布者/订阅者页面访问 API Manager 统计信息。(请参阅下面的 store_analytics.png)
希望这些信息对您有所帮助。