diff --git a/apimanager/metrics/static/metrics/js/lastEndpointMetric.js b/apimanager/metrics/static/metrics/js/lastEndpointMetric.js new file mode 100644 index 00000000..7e623329 --- /dev/null +++ b/apimanager/metrics/static/metrics/js/lastEndpointMetric.js @@ -0,0 +1,16 @@ +$(document).ready(function($) { + getMetricLastEndpoint(); +}); + +function getMetricLastEndpoint(){ + $.ajax({url: "/metrics/api/last-endpoint", success: function(result){ + var content = "" + +result['implemented_by_partial_function']+" took " + +result['duration']+" ms at " + +result['date']+" " + +result['verb']+" " + + result['url']; + $("#last_endpoint").text(content); + setTimeout(function(){getMetricLastEndpoint();}, 5000); // will call function to update time every 5 seconds + }}); +} diff --git a/apimanager/metrics/templates/metrics/api.html b/apimanager/metrics/templates/metrics/api.html index 24d13c52..b335207c 100644 --- a/apimanager/metrics/templates/metrics/api.html +++ b/apimanager/metrics/templates/metrics/api.html @@ -3,7 +3,9 @@ {% load i18n %} {% block page_title %}{{ block.super }} / API Metrics{% endblock page_title %} - +{% block extrajs %} + +{% endblock extrajs %} {% load bootstrap3 %} {% block content %}
getBanks took 43ms at 2023-12-06T11:00:49Z GET /obp/v4.0.0/banks ms.