mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 12:46:54 +00:00
feature/added the lastEndpoint info on metric page - tweaked the page content
This commit is contained in:
parent
d196ae7868
commit
e31d48dbe7
@ -4,12 +4,13 @@ $(document).ready(function($) {
|
||||
|
||||
function getMetricLastEndpoint(){
|
||||
$.ajax({url: "/metrics/api/last-endpoint", success: function(result){
|
||||
var content = "Last call: "
|
||||
+result['app_name']+" "
|
||||
var content = ""
|
||||
+result['implemented_by_partial_function']+" took "
|
||||
+result['duration']+"ms at "
|
||||
+result['date']+" "
|
||||
+result['verb']+" "
|
||||
+ result['implemented_by_partial_function']
|
||||
+" costed "
|
||||
+result['duration']
|
||||
+ result['url']
|
||||
|
||||
+" ms.";
|
||||
$("#last_endpoint").text(content);
|
||||
setTimeout(function(){getMetricLastEndpoint();}, 5000); // will call function to update time every 5 seconds
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
{{ form.media }} {# Form required JS and CSS #}
|
||||
{% endblock %}
|
||||
<h1>{% trans "API Metrics" %}</h1>
|
||||
<h5 id ="last_endpoint">Last call: API Manager getMetrics costed 294 ms</h5>
|
||||
<h5 id ="last_endpoint">getBanks took 43ms at 2023-12-06T11:00:49Z GET /obp/v4.0.0/banks ms. </h5>
|
||||
<div id="metrics-filter">
|
||||
<h2>{% trans "Filter" %}</h2>
|
||||
<form action="" method="get">
|
||||
|
||||
@ -209,10 +209,11 @@ def get_metric_last_endpoint(request):
|
||||
try:
|
||||
metric = api.get(urlpath)['metrics'][0]
|
||||
last_endpoint_metric={
|
||||
'app_name':metric['app_name'],
|
||||
'verb': metric['verb'],
|
||||
'implemented_by_partial_function': metric['implemented_by_partial_function'],
|
||||
'duration': metric['duration']
|
||||
'implemented_by_partial_function':metric['implemented_by_partial_function'],
|
||||
'duration': metric['duration'],
|
||||
'date': metric['date'],
|
||||
'verb': metric['verb'],
|
||||
'url': metric['url']
|
||||
}
|
||||
except Exception as err:
|
||||
LOGGER.exception('error_once_only - Error Message: {}'.format(err))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user