DB commands to get dashboard metrics from the CA Layer7 API Gateway
search cancel

DB commands to get dashboard metrics from the CA Layer7 API Gateway

book

Article ID: 269676

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

 Are there known DB commands to get dashboard metrics?

Environment

API Gateway any version

Resolution

To get metrics directly from the DB:

# mysql ssg

mysql>

select ps.name, from_unixtime(sm.start_time/1000, '%Y %D %M %H:%i:%s') as start, from_unixtime(sm.end_time/1000, '%Y %D %M %H:%i:%s') as End, sm.attempted, sm.completed from service_metrics sm join published_service ps on sm.published_service_goid = ps.goid where start_time/1000 > UNIX_TIMESTAMP(NOW() - INTERVAL 3 MONTH);

For a summary view group by service and sum the hits:

mysql>

select ps.routing_uri as URL, sum(sm.attempted) as attempted, sum(sm.completed) as completed from service_metrics sm join published_service ps on sm.published_service_goid = ps.goid where start_time/1000 > UNIX_TIMESTAMP(NOW() - INTERVAL 3 MONTH) and attempted <> 0 group by ps.routing_uri;

Results from the SUM/Group above:

+--------------+-----------+-----------+
| URL          | attempted | completed |
+--------------+-----------+-----------+
| /r2          |        13 |         6 |
| /MyServ   |        17 |         6 |
| /Pass        |        78 |        67 |
| /echo/*      |         1 |         1 |
| /Some        |         7 |         7 |
| /restman/*   |        25 |        10 |

This interval 3 month can be changed to 1 day or the desired time period in the above queries.